architecture-js 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/architecture-js.gemspec +1 -1
- data/lib/architecture-js/blueprint.rb +6 -1
- data/lib/architecture-js/generator.rb +6 -2
- data/spec/generator_spec.rb +3 -3
- metadata +20 -20
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/architecture-js.gemspec
CHANGED
@@ -42,7 +42,12 @@ module ArchitectureJS
|
|
42
42
|
@config.merge! config unless config.nil?
|
43
43
|
@generator = ArchitectureJS::Generator.new self
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
|
+
def add_templates(dir)
|
47
|
+
[*dir].each { |d| @template_directories << d }
|
48
|
+
@generator.load_templates
|
49
|
+
end
|
50
|
+
|
46
51
|
def read_config
|
47
52
|
config = YAML::load_file("#{@root}/#{@config_file}")
|
48
53
|
assign_config_variables config
|
@@ -11,17 +11,21 @@ module ArchitectureJS
|
|
11
11
|
@blueprint = @project.config
|
12
12
|
@template_paths = @project.template_directories
|
13
13
|
@templates = Hash.new
|
14
|
-
|
14
|
+
load_templates
|
15
15
|
end
|
16
16
|
|
17
17
|
def find_templates(paths)
|
18
|
-
paths.each do |path|
|
18
|
+
[*paths].each do |path|
|
19
19
|
Dir["#{path}/*"].each do |file|
|
20
20
|
add_file_to_templates file
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
def load_templates
|
26
|
+
find_templates @template_paths
|
27
|
+
end
|
28
|
+
|
25
29
|
def add_file_to_templates(file)
|
26
30
|
ext = File.extname(file)
|
27
31
|
template_name = File.basename(file, ext)
|
data/spec/generator_spec.rb
CHANGED
@@ -10,8 +10,8 @@ describe ArchitectureJS::Generator do
|
|
10
10
|
FileUtils.cp "#{FIXTURES}/templates/env_template.js", "#{TMP_DIR}/env_template.js"
|
11
11
|
|
12
12
|
project = ArchitectureJS::Blueprint.new({ name: 'myapp' }, TMP_DIR)
|
13
|
-
project.
|
14
|
-
@gen =
|
13
|
+
project.add_templates "#{FIXTURES}/templates"
|
14
|
+
@gen = project.generator
|
15
15
|
end
|
16
16
|
|
17
17
|
after :each do
|
@@ -27,7 +27,7 @@ describe ArchitectureJS::Generator do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'should have template_paths' do
|
30
|
-
@gen.template_paths.should == ["#{FIXTURES}/templates"]
|
30
|
+
@gen.template_paths.should == ["#{ArchitectureJS::base_directory}/templates", "#{TMP_DIR}/templates", "#{FIXTURES}/templates"]
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'should find all the templates' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: architecture-js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-27 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fssm
|
16
|
-
requirement: &
|
16
|
+
requirement: &70128067772620 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.2.8.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70128067772620
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jsmin
|
27
|
-
requirement: &
|
27
|
+
requirement: &70128067772020 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.1
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70128067772020
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70128067771440 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.8.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70128067771440
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &70128067770940 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.0.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70128067770940
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: jeweler
|
60
|
-
requirement: &
|
60
|
+
requirement: &70128067770420 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.8.3
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70128067770420
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: ZenTest
|
71
|
-
requirement: &
|
71
|
+
requirement: &70128067765440 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 4.6.2
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70128067765440
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: autotest-growl
|
82
|
-
requirement: &
|
82
|
+
requirement: &70128067764840 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 0.2.16
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70128067764840
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: jsmin
|
93
|
-
requirement: &
|
93
|
+
requirement: &70128067764240 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70128067764240
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: fssm
|
104
|
-
requirement: &
|
104
|
+
requirement: &70128067763640 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70128067763640
|
113
113
|
description: Architecture.js helps you generate scaffolding, manage third-party packages,
|
114
114
|
compile, and compress your application.
|
115
115
|
email: daytonn@gmail.com
|
@@ -225,7 +225,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
225
225
|
version: '0'
|
226
226
|
segments:
|
227
227
|
- 0
|
228
|
-
hash: -
|
228
|
+
hash: -688315577623791318
|
229
229
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
230
230
|
none: false
|
231
231
|
requirements:
|