sugar-high 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,7 +1,7 @@
1
1
  require 'active_support/inflector'
2
2
 
3
3
  def modules *module_names, &block
4
- module_names.each do |name|
4
+ module_names.flatten.each do |name|
5
5
  class_eval %{
6
6
  module #{name.to_s.camelize}
7
7
  #{yield block if block}
@@ -11,11 +11,11 @@ def modules *module_names, &block
11
11
  end
12
12
 
13
13
  def nested_modules *module_names, &block
14
- module_names.inject([]) do |res, name|
14
+ module_names.flatten.inject([]) do |res, name|
15
15
  res << %{
16
16
  module #{name.to_s.camelize}
17
17
  #{yield block if block}
18
18
  end}
19
- end.join("\n")
19
+ end.flatten.join("\n")
20
20
  end
21
21
 
@@ -11,6 +11,11 @@ module Nested
11
11
  end
12
12
  end
13
13
 
14
+ module AuthAssistant
15
+ NAMESPACES = [:view, :controller, :model, :link, :helper]
16
+
17
+ modules NAMESPACES
18
+ end
14
19
 
15
20
  describe "SugarHigh" do
16
21
  describe "Module ext" do
@@ -20,6 +25,11 @@ describe "SugarHigh" do
20
25
  Simple::Y.should_not be_nil
21
26
  end
22
27
 
28
+ it "should create namespaces under AuthAssistant for various modules" do
29
+ AuthAssistant::View.should_not be_nil
30
+ AuthAssistant::Helper.should_not be_nil
31
+ end
32
+
23
33
  it "should create namespaces under Nested for modules X and Y, and modules A and B under each of those X and Y modules" do
24
34
  Nested::X.should_not be_nil
25
35
  Nested::Y.should_not be_nil
data/sugar-high.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sugar-high}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup