Skip to content

Commit

Permalink
Merge pull request #9 from jessedoyle/fix-runtime
Browse files Browse the repository at this point in the history
Fix runtime require
  • Loading branch information
jessedoyle committed Jan 3, 2016
2 parents 4fc7b5e + 8419192 commit d763dd4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# v0.6.4 - Jan 2, 2016

- Add the `src/runtime.cr` file so you can now properly `require "./duktape/runtime"` once `shards` does its thing.
- Actually update the version in `shard.yml` (my mistake - sorry!).

# v0.6.3 - Jan 2, 2016

**NOTE - This release has issues, use `0.6.4` instead.**

- Rework the internal require order and `duktape/base`.
- Add a `Duktape::Runtime` class that lessens the need for low-level API calls for many use-cases. This must be required using `require "duktape/runtime"`.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ version: 1.0.0 # your project's version
dependencies:
duktape:
github: jessedoyle/duktape.cr
version: ~> 0.6.3
version: ~> 0.6.4
```
then execute:
Expand Down
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: duktape.cr
version: 0.6.2
version: 0.6.4

authors:
- Jesse Doyle <[email protected]>
Expand Down
14 changes: 7 additions & 7 deletions src/duktape/runtime.cr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Duktape
#
# ```
# rt = Duktape::Runtime.new
# rt.eval("Math.PI") #=> 3.14159
# rt.eval("Math.PI") # => 3.14159
# ```
#
# The Runtime class also allows for javascript initialization code:
Expand All @@ -29,7 +29,7 @@ module Duktape
# JS
# end
#
# rt.eval("add_one", 42) #=> 43
# rt.eval("add_one", 42) # => 43
# ```
#
# The Runtime class is not loaded by default and must be required before
Expand Down Expand Up @@ -85,8 +85,8 @@ module Duktape
# The property string can include parent objects:
#
# ```
# rt = Duktape::Runtime.new
# rt.call("JSON.stringify", 123) #=> "123"
# rt = Duktape::Runtime.new
# rt.call("JSON.stringify", 123) # => "123"
# ```
#
def call(prop : String, *args)
Expand All @@ -97,8 +97,8 @@ module Duktape
# array of strings with the supplied arguments.
#
# ```
# rt = Duktape::Runtime.new
# rt.call(["Math", "PI"]) #=> 3.14159
# rt = Duktape::Runtime.new
# rt.call(["Math", "PI"]) # => 3.14159
# ```
#
def call(props : Array(String), *args)
Expand Down Expand Up @@ -141,7 +141,7 @@ module Duktape
#
# ```
# rt = Duktape::Runtime.new
# rt.exec("1 + 1") #=> nil
# rt.exec("1 + 1") # => nil
# ```
#
def exec(source : String)
Expand Down
2 changes: 1 addition & 1 deletion src/duktape/version.cr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Duktape
module VERSION
MAJOR = 0
MINOR = 6
TINY = 3
TINY = 4
PRE = nil

STRING = [MAJOR, MINOR, TINY, PRE].compact.join "."
Expand Down
7 changes: 7 additions & 0 deletions src/runtime.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# runtime.cr: simplified Duktape call/eval interface
#
# Copyright (c) 2016 Jesse Doyle. All rights reserved.
#
# This is free software. Please see LICENSE for details.

require "./duktape/runtime"

0 comments on commit d763dd4

Please sign in to comment.