mongoscript 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/changelog.md ADDED
@@ -0,0 +1,2 @@
1
+ v0.0.10
2
+ - Use the underscore version of the function name as the filename, not the camelCased name
@@ -43,7 +43,8 @@ module MongoScript
43
43
  #
44
44
  # @returns the script contents
45
45
  def code_for(script_name)
46
- script_name = script_name.to_s
46
+ script_name = script_name.to_s.underscore
47
+ # we can use underscore since we use ActiveSupport
47
48
  dir = @script_dirs.find {|d| File.exists?(File.join(d, "#{script_name}.js"))}
48
49
  raise ScriptNotFound, "Unable to find script #{script_name}" unless dir
49
50
  code = File.read(File.join(dir, "#{script_name}.js"))
@@ -1,3 +1,3 @@
1
1
  module Mongoscript
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
data/readme.md CHANGED
@@ -56,4 +56,4 @@ A more detailed readme, with usage instructions and so on.
56
56
 
57
57
  ###Note on Dependencies###
58
58
 
59
- Since this is currently experimental/for fun, I'm relying on ActiveSupport for HashWithIndifferentAccess and Concern. I acknowledge this restricts the gem to projects where ActiveSupport is an option, but should be easy enough to rip out if someone wants to use this seriously.
59
+ Since this is currently experimental/for fun, I'm relying on ActiveSupport for HashWithIndifferentAccess and Concern. I acknowledge this restricts the gem to projects where ActiveSupport is an option, but should be easy enough to rip out if someone wants to use this seriously. (The hardest part would be removing underscore, used in execution.rb.)
@@ -56,6 +56,10 @@ describe MongoScript::Execution do
56
56
  ObjectWithExecution.code_for(:sample_script).should == @script_code
57
57
  end
58
58
 
59
+ it "underscores the filename (since JS function names will be passed in too)" do
60
+ ObjectWithExecution.code_for("sampleScript").should == @script_code
61
+ end
62
+
59
63
  it "stores the value in LOADED_SCRIPTS" do
60
64
  ObjectWithExecution.code_for(:sample_script)
61
65
  ObjectWithExecution::LOADED_SCRIPTS["sample_script"].should == @script_code
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-06 00:00:00.000000000 Z
12
+ date: 2012-04-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70280991269600 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,12 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70280991269600
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
25
30
  description: An experimental Ruby library for running serverside Javascript in MongoDB.
26
31
  email:
27
32
  - alex+git@alexkoppel.com
@@ -34,6 +39,7 @@ files:
34
39
  - Gemfile
35
40
  - Guardfile
36
41
  - Rakefile
42
+ - changelog.md
37
43
  - lib/mongoscript.rb
38
44
  - lib/mongoscript/execution.rb
39
45
  - lib/mongoscript/javascripts/multiquery.js
@@ -77,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
83
  version: '0'
78
84
  requirements: []
79
85
  rubyforge_project:
80
- rubygems_version: 1.8.15
86
+ rubygems_version: 1.8.21
81
87
  signing_key:
82
88
  specification_version: 3
83
89
  summary: An experimental Ruby library for running serverside Javascript in MongoDB.