commonjs 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 194a8ece145d5fcefa716f8a07a702ac184ceaae
4
+ data.tar.gz: c46f5455c791c952659a6308f548f49ed78f164c
5
+ SHA512:
6
+ metadata.gz: 8ec56c1e69134e0af7d448cfc0a1fcbb08d6c185448e2f8efc15f477328afa30c6586e5b7d0096623442c3383d1eab0da826bdbc2b2f1c95d2d67ed768db32b4
7
+ data.tar.gz: a13d771825ca13d92b9b14308dfb08dab4582dca29f5715fed7db5839816d2d007b7cc306df2188a336badb2dc578231da6913d45e5339ca7e5387d3ed3ef84f
@@ -0,0 +1,23 @@
1
+ (The MIT License: http://www.opensource.org/licenses/MIT)
2
+
3
+ Copyright (c) 2011,2012 Charles Lowell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files
7
+ (the "Software"), to deal in the Software without restriction,
8
+ including without limitation the rights to use, copy, modify, merge,
9
+ publish, distribute, sublicense, and/or sell copies of the Software,
10
+ and to permit persons to whom the Software is furnished to do so,
11
+ subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
data/README.md CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  # CommonJS [![Build Status](https://secure.travis-ci.org/cowboyd/commonjs.rb.png)](http://travis-ci.org/cowboyd/commonjs.rb)
3
2
 
4
3
  Host CommonJS JavaScript environments in Ruby
@@ -14,12 +13,12 @@ able to use commonjs applications and libraries?
14
13
 
15
14
  ## Using common JS from Ruby.
16
15
 
17
- `CommonJS` now passes all of the Modules 1.0 unit tests
18
-
19
- env = CommonJS::Environment.new(:path => '/path/to/lib/dir')
20
- env.require('foo.js')
21
-
16
+ `CommonJS` now passes all of the Modules 1.0 unit tests.
22
17
 
18
+ ```ruby
19
+ env = CommonJS::Environment.new(:path => '/path/to/lib/dir')
20
+ env.require('foo.js')
21
+ ```
23
22
 
24
23
  ## Future directions
25
24
 
@@ -29,7 +28,9 @@ The plan however, is to allow you to extend your commonjs environment to have wh
29
28
  interfaces you want in it. So for example, if you want to allow filesystem access, as well as
30
29
  access to the process information, you would say:
31
30
 
32
- env.modules :filesystem, :process
31
+ ```ruby
32
+ env.modules :filesystem, :process
33
+ ```
33
34
 
34
35
  ## Supported runtimes
35
36
 
@@ -31,9 +31,12 @@ module CommonJS
31
31
  private
32
32
 
33
33
  def find(module_id)
34
- if loadpath = @paths.find { |path| path.join("#{module_id}.js").exist? }
35
- loadpath.join("#{module_id}.js")
34
+ # Add `.js` extension if neccessary.
35
+ target = if File.extname(module_id) == '.js' then module_id else "#{module_id}.js" end
36
+ if loadpath = @paths.find { |path| path.join(target).exist? }
37
+ loadpath.join(target)
36
38
  end
37
39
  end
40
+
38
41
  end
39
42
  end
@@ -1,3 +1,3 @@
1
1
  module CommonJS
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,38 +1,64 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commonjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
5
- prerelease:
4
+ version: 0.2.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Charles Lowell
9
8
  autorequire:
10
9
  bindir: bin
11
- cert_chain: []
12
- date: 2012-04-24 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRAwDgYDVQQDDAdjb3di
14
+ b3lkMRwwGgYKCZImiZPyLGQBGRYMdGhlZnJvbnRzaWRlMRMwEQYKCZImiZPyLGQB
15
+ GRYDbmV0MB4XDTEzMDEzMDIxMDYwNFoXDTE0MDEzMDIxMDYwNFowRTEQMA4GA1UE
16
+ AwwHY293Ym95ZDEcMBoGCgmSJomT8ixkARkWDHRoZWZyb250c2lkZTETMBEGCgmS
17
+ JomT8ixkARkWA25ldDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAO45
18
+ CUxpETDGYXjCCy2dMg/aIrdrTqBqQW5ZrzhHxF9EkcdmWFr0z/qMz0JSpZ3pF11Z
19
+ KYaj5PaQQpjZfLPwbuiGGkuSWi+UAac//V18xo6S4lzRBjO+gpzG9f2AOzt9b+SR
20
+ Uc8UhO7QBZ5edUDxMxw9QstD+U0YBAlzsPJbHuUOqdtxXmNQCds3ZnqTgZaIpdUy
21
+ CSejtrukSmlthxFzwgMezYQhcYxmkl+Q475JUodnI6Pjc6nja/Or8Y6cEWiLgeUa
22
+ a+efcPGLDEbwJC7TGRrvk8yassMByBEJ3XueTMzeqWFd+665ptciojYo6BvIAR0N
23
+ iLwks0x567FZyS8SqTcCAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQUxVgR
24
+ 5TUqf7Hd24ICb3g4FNbM7oYwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IB
25
+ AQDdJj+NzZhiYXA56z0wzRUA/Fcf6CYqKB+RFRlPssDEcHTor5SnwdWgQof/gNLi
26
+ Qel1Om4zO0Shcp89jxaUqtvEdYVhmyfc0vycHmemKttNBT734yMrEJtF8Hhy+Dnz
27
+ 9CzixXLvgGaRH+mf3M0+l+zIDJJr2L+39L8cyTSSRnp/srfI8aSmJKhGshudBKoC
28
+ Ty6Gi071pwoJXvdMaE/6iPy7bUzlndYdHyYuWSKaO9N47HqQ62oEnBraglw6ghoi
29
+ UgImJlChAzCoDP9zi9tdm6jAr7ttF25R9PPYr11ILb7dYe3qUzlNlM6zJx/nb31b
30
+ IhdyRVup4qLcqYSTPsm6u7VA
31
+ -----END CERTIFICATE-----
32
+ date: 2013-09-03 00:00:00.000000000 Z
13
33
  dependencies:
14
34
  - !ruby/object:Gem::Dependency
15
35
  name: rake
16
- requirement: &2157025180 !ruby/object:Gem::Requirement
17
- none: false
36
+ requirement: !ruby/object:Gem::Requirement
18
37
  requirements:
19
- - - ! '>='
38
+ - - '>='
20
39
  - !ruby/object:Gem::Version
21
40
  version: '0'
22
41
  type: :development
23
42
  prerelease: false
24
- version_requirements: *2157025180
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
25
48
  - !ruby/object:Gem::Dependency
26
49
  name: rspec
27
- requirement: &2157024040 !ruby/object:Gem::Requirement
28
- none: false
50
+ requirement: !ruby/object:Gem::Requirement
29
51
  requirements:
30
- - - ! '>='
52
+ - - '>='
31
53
  - !ruby/object:Gem::Version
32
54
  version: '0'
33
55
  type: :development
34
56
  prerelease: false
35
- version_requirements: *2157024040
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
36
62
  description: Host CommonJS JavaScript environments in Ruby
37
63
  email:
38
64
  - cowboyd@thefrontside.net
@@ -44,6 +70,7 @@ files:
44
70
  - .gitmodules
45
71
  - .travis.yml
46
72
  - Gemfile
73
+ - LICENSE.txt
47
74
  - README.md
48
75
  - Rakefile
49
76
  - commonjs.gemspec
@@ -62,27 +89,26 @@ files:
62
89
  - spec/spec_helper.rb
63
90
  homepage: http://github.com/cowboyd/commonjs.rb
64
91
  licenses: []
92
+ metadata: {}
65
93
  post_install_message:
66
94
  rdoc_options: []
67
95
  require_paths:
68
96
  - lib
69
97
  required_ruby_version: !ruby/object:Gem::Requirement
70
- none: false
71
98
  requirements:
72
- - - ! '>='
99
+ - - '>='
73
100
  - !ruby/object:Gem::Version
74
101
  version: '0'
75
102
  required_rubygems_version: !ruby/object:Gem::Requirement
76
- none: false
77
103
  requirements:
78
- - - ! '>='
104
+ - - '>='
79
105
  - !ruby/object:Gem::Version
80
106
  version: '0'
81
107
  requirements: []
82
108
  rubyforge_project:
83
- rubygems_version: 1.8.17
109
+ rubygems_version: 2.0.0
84
110
  signing_key:
85
- specification_version: 3
111
+ specification_version: 4
86
112
  summary: Provide access to your Ruby and Operating System runtime via the commonjs
87
113
  API
88
114
  test_files:
@@ -95,3 +121,4 @@ test_files:
95
121
  - spec/commonjs/modules_spec.rb
96
122
  - spec/commonjs/path_spec.rb
97
123
  - spec/spec_helper.rb
124
+ has_rdoc: