expand 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8eefdf8421d88d75e752a92262a63aa0ab5b66d
4
- data.tar.gz: 765b248f040050472314a7a41f47112c46b02e16
3
+ metadata.gz: 67a04674a13b0dbfca22f2452f5f206af05452bb
4
+ data.tar.gz: 7ea40c2d4bae7463a3ad99420107e96a5fc4d2e7
5
5
  SHA512:
6
- metadata.gz: fcc95af895dc067897c1bb317ac648a64b6ec78d35e91cdfc6d490bbf72e369304dc5c68251b0defe9437abfb49052364f9536f1e7c233fd899eb34c7470eebe
7
- data.tar.gz: 313b4e3b52652337c358c2c043d1a7461f5b0cdf18c26c430dd0bdf6e0ea8bfecbc97d04ffbf9119133b086329414f38470b205b5d5e0315a3200c0502cc4b28
6
+ metadata.gz: 8df7158a2bdaf8375cc5d8b7f782ae367fc081efcdd17e21352d252d20f3d1dfe33b3718046f693b58567fa58949514905373e70e850cfd3bcb8767478512c92
7
+ data.tar.gz: 8c8f197f5ce23a87e9db11382be77e3f97b0ce50f07f7013c4390d72d335f6020727993f9bbf107f6e7f86dfc632b51a1dcd4bc4ec83a75bba58123251310d89
@@ -0,0 +1,6 @@
1
+ ## 1.0.1
2
+ - allow specified namespace to be a module instead of a string
3
+
4
+ ## 1.0.0 (2016-01-14)
5
+ Initial release.
6
+ - allow creation of classes and modules under a namespace
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Epand
1
+ # Expand
2
2
 
3
3
  Use Expand to create classes or modules under an existing namespace.
4
4
 
@@ -25,7 +25,7 @@ To make this simpler, you can require `expand` and extend your current context w
25
25
  reuire 'expand'
26
26
  extend Expand
27
27
 
28
- namespace 'SomeGem::Thing' do
28
+ namespace SomeGem::Thing do
29
29
  create_class :NewThing do
30
30
  # define methods here
31
31
  end
@@ -19,11 +19,13 @@ module Expand
19
19
  end
20
20
  end
21
21
 
22
- def namespace(string, &block)
23
- namespace = string.split('::').inject(Object) do |base, mod|
24
- base.const_get(mod)
22
+ def namespace(context, &block)
23
+ unless context.is_a?(Module)
24
+ context = context.to_s.split('::').inject(Object) do |base, mod|
25
+ base.const_get(mod)
26
+ end
25
27
  end
26
- Manager.new(namespace).instance_eval(&block)
28
+ Manager.new(context).instance_eval(&block)
27
29
  end
28
30
  alias expand namespace
29
31
  end
@@ -1,3 +1,3 @@
1
1
  module Expand
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expand
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "'Jim Gay'"
@@ -61,6 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
63
  - ".travis.yml"
64
+ - CHANGELOG.md
64
65
  - CODE_OF_CONDUCT.md
65
66
  - Gemfile
66
67
  - LICENSE.txt