architecture-js 0.1.9 → 0.1.10
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.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/architecture-js.gemspec +8 -3
- data/lib/architecture-js/project.rb +9 -6
- data/spec/fixtures/_hidden.js +0 -0
- data/spec/fixtures/lib1_compressed.js +1 -0
- data/spec/fixtures/lib2_compressed.js +1 -0
- data/spec/fixtures/src_file.js +2 -2
- data/spec/fixtures/update.architecture +6 -0
- data/spec/fixtures/update.js +2 -0
- data/spec/project_spec.rb +38 -2
- metadata +31 -26
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ require 'jeweler'
|
|
13
13
|
Jeweler::Tasks.new do |gem|
|
14
14
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
15
|
gem.name = "architecture-js"
|
16
|
-
gem.homepage = "
|
16
|
+
gem.homepage = "https://github.com/daytonn/architecture-js"
|
17
17
|
gem.license = "MIT"
|
18
18
|
gem.summary = %Q{architecture.js is a command line application to dynamically build and manage complex javascript applications.}
|
19
19
|
gem.description = %Q{Architecture.js helps you generate scaffolding, manage third-party packages, compile, and compress your application.}
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.10
|
data/architecture-js.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "architecture-js"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.10"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dayton Nolan"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-02-04"
|
13
13
|
s.description = "Architecture.js helps you generate scaffolding, manage third-party packages, compile, and compress your application."
|
14
14
|
s.email = "daytonn@gmail.com"
|
15
15
|
s.executables = ["architect"]
|
@@ -43,19 +43,24 @@ Gem::Specification.new do |s|
|
|
43
43
|
"spec/cli_spec.rb",
|
44
44
|
"spec/command_spec.rb",
|
45
45
|
"spec/fixtures/.DS_Store",
|
46
|
+
"spec/fixtures/_hidden.js",
|
46
47
|
"spec/fixtures/compiled_src.js",
|
47
48
|
"spec/fixtures/compressed.architecture",
|
48
49
|
"spec/fixtures/compressed.js",
|
49
50
|
"spec/fixtures/ejs.ejs",
|
50
51
|
"spec/fixtures/existing.architecture",
|
51
52
|
"spec/fixtures/lib1.js",
|
53
|
+
"spec/fixtures/lib1_compressed.js",
|
52
54
|
"spec/fixtures/lib2.js",
|
55
|
+
"spec/fixtures/lib2_compressed.js",
|
53
56
|
"spec/fixtures/myapp.architecture",
|
54
57
|
"spec/fixtures/src_file.js",
|
55
58
|
"spec/fixtures/templates/test_template_one.js",
|
56
59
|
"spec/fixtures/templates/test_template_two.js",
|
57
60
|
"spec/fixtures/test_template_options.js",
|
58
61
|
"spec/fixtures/test_template_two.js",
|
62
|
+
"spec/fixtures/update.architecture",
|
63
|
+
"spec/fixtures/update.js",
|
59
64
|
"spec/generator_spec.rb",
|
60
65
|
"spec/helpers_spec.rb",
|
61
66
|
"spec/notification_spec.rb",
|
@@ -63,7 +68,7 @@ Gem::Specification.new do |s|
|
|
63
68
|
"spec/spec_helper.rb",
|
64
69
|
"templates/blank.js"
|
65
70
|
]
|
66
|
-
s.homepage = "
|
71
|
+
s.homepage = "https://github.com/daytonn/architecture-js"
|
67
72
|
s.licenses = ["MIT"]
|
68
73
|
s.require_paths = ["lib"]
|
69
74
|
s.rubygems_version = "1.8.10"
|
@@ -66,7 +66,7 @@ module ArchitectureJS
|
|
66
66
|
Dir.mkdir "#{@root}" unless File.exists? "#{@root}"
|
67
67
|
|
68
68
|
@directories.each do |dir|
|
69
|
-
puts ArchitectureJS::Notification.added "#{dir} created" unless File.exists? "#{@root}/#{dir}"
|
69
|
+
puts ArchitectureJS::Notification.added "#{dir}/ created" unless File.exists? "#{@root}/#{dir}"
|
70
70
|
Dir.mkdir "#{@root}/#{dir}" unless File.exists? "#{@root}/#{dir}"
|
71
71
|
end
|
72
72
|
end
|
@@ -84,9 +84,11 @@ module ArchitectureJS
|
|
84
84
|
|
85
85
|
def create_application_file
|
86
86
|
FileUtils.touch("#{@root}/#{@config[:src_dir]}/#{@config[:name]}.js")
|
87
|
+
puts ArchitectureJS::Notification.added "#{@config[:src_dir]}/#{@config[:name]}.js created"
|
87
88
|
end
|
88
89
|
|
89
90
|
def update
|
91
|
+
read_config
|
90
92
|
get_src_files
|
91
93
|
compile_src_files
|
92
94
|
compress_application if @config[:output] == 'compressed'
|
@@ -116,15 +118,16 @@ module ArchitectureJS
|
|
116
118
|
|
117
119
|
def compile_src_file(file_path, file_name)
|
118
120
|
sprockets = Sprockets::Secretary.new(
|
119
|
-
:
|
120
|
-
:
|
121
|
-
:
|
122
|
-
source_files: [
|
121
|
+
root: ArchitectureJS::BASE_DIR,
|
122
|
+
asset_root: @config[:asset_root],
|
123
|
+
load_path: ['repository'],
|
124
|
+
source_files: [file_path]
|
123
125
|
)
|
124
126
|
|
125
127
|
compiled_file = sprockets.concatenation
|
126
|
-
message = File.exists?("#{@root}/#{@config[:build_dir]}/#{file_name}.js") ? "
|
128
|
+
message = File.exists?("#{@root}/#{@config[:build_dir]}/#{file_name}.js") ? "#{@config[:build_dir]}/#{file_name}.js updated" : "#{@config[:build_dir]}/#{file_name}.js created"
|
127
129
|
compiled_file.save_to "#{@root}/#{@config[:build_dir]}/#{file_name}.js"
|
130
|
+
ArchitectureJS::Notification.log message
|
128
131
|
sprockets.install_assets
|
129
132
|
|
130
133
|
rescue Exception => error
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
var file_one='one';
|
@@ -0,0 +1 @@
|
|
1
|
+
var file_two='two';
|
data/spec/fixtures/src_file.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
//= require "
|
2
|
-
//= require "
|
1
|
+
//= require "lib1"
|
2
|
+
//= require "lib2"
|
data/spec/project_spec.rb
CHANGED
@@ -94,9 +94,10 @@ describe ArchitectureJS::Project do
|
|
94
94
|
suppress_output do
|
95
95
|
@project = ArchitectureJS::Project.new({ name: 'myapp' },TMP_DIR)
|
96
96
|
@project.create
|
97
|
-
FileUtils.cp "#{FIXTURES}/lib1.js", "#{TMP_DIR}/
|
98
|
-
FileUtils.cp "#{FIXTURES}/lib2.js", "#{TMP_DIR}/
|
97
|
+
FileUtils.cp "#{FIXTURES}/lib1.js", "#{TMP_DIR}/src/lib1.js"
|
98
|
+
FileUtils.cp "#{FIXTURES}/lib2.js", "#{TMP_DIR}/src/lib2.js"
|
99
99
|
FileUtils.cp "#{FIXTURES}/src_file.js", "#{TMP_DIR}/src/myapp.js"
|
100
|
+
FileUtils.cp "#{FIXTURES}/_hidden.js", "#{TMP_DIR}/src/"
|
100
101
|
@project.update
|
101
102
|
end
|
102
103
|
end
|
@@ -108,12 +109,47 @@ describe ArchitectureJS::Project do
|
|
108
109
|
it 'should compile the source files into the destination folder' do
|
109
110
|
File.exists?("#{TMP_DIR}/lib/myapp.js").should be_true
|
110
111
|
"#{TMP_DIR}/lib/myapp.js".should be_same_file_as "#{FIXTURES}/compressed.js"
|
112
|
+
|
113
|
+
File.exists?("#{TMP_DIR}/lib/lib1.js").should be_true
|
114
|
+
"#{TMP_DIR}/lib/lib1.js".should be_same_file_as "#{FIXTURES}/lib1_compressed.js"
|
115
|
+
|
116
|
+
File.exists?("#{TMP_DIR}/lib/lib2.js").should be_true
|
117
|
+
"#{TMP_DIR}/lib/lib2.js".should be_same_file_as "#{FIXTURES}/lib2_compressed.js"
|
111
118
|
end
|
112
119
|
|
113
120
|
it 'should compress the application file' do
|
114
121
|
FileUtils.cp "#{FIXTURES}/compressed.architecture", "#{TMP_DIR}/myapp.architecture"
|
115
122
|
@project.config[:output].should == 'compressed'
|
116
123
|
end
|
124
|
+
|
125
|
+
it 'should not compile src files begining with _' do
|
126
|
+
File.exists?("#{TMP_DIR}/lib/_hidden.js").should_not be_true
|
127
|
+
end
|
128
|
+
|
117
129
|
end # Project Update
|
118
130
|
|
131
|
+
context "- Config Update -" do
|
132
|
+
before :each do
|
133
|
+
FileUtils.mkdir("#{TMP_DIR}")
|
134
|
+
suppress_output do
|
135
|
+
@project = ArchitectureJS::Project.new({ name: 'myapp' },TMP_DIR)
|
136
|
+
@project.create
|
137
|
+
FileUtils.cp "#{FIXTURES}/update.architecture", "#{TMP_DIR}/myapp.architecture"
|
138
|
+
FileUtils.cp "#{FIXTURES}/lib1.js", "#{TMP_DIR}/src/lib1.js"
|
139
|
+
FileUtils.cp "#{FIXTURES}/lib2.js", "#{TMP_DIR}/src/lib2.js"
|
140
|
+
FileUtils.cp "#{FIXTURES}/src_file.js", "#{TMP_DIR}/src/myapp.js"
|
141
|
+
FileUtils.cp "#{FIXTURES}/_hidden.js", "#{TMP_DIR}/src/"
|
142
|
+
@project.update
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
after :each do
|
147
|
+
FileUtils.rm_rf "#{TMP_DIR}" if File.exists? "#{TMP_DIR}"
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'should update with fresh config values' do
|
151
|
+
"#{TMP_DIR}/lib/myapp.js".should be_same_file_as "#{FIXTURES}/update.js"
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
119
155
|
end
|
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.1.
|
4
|
+
version: 0.1.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-
|
12
|
+
date: 2012-02-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fssm
|
16
|
-
requirement: &
|
16
|
+
requirement: &70308037156640 !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: *70308037156640
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jsmin
|
27
|
-
requirement: &
|
27
|
+
requirement: &70308037156140 !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: *70308037156140
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sprockets
|
38
|
-
requirement: &
|
38
|
+
requirement: &70308037155640 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - =
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.0.2
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70308037155640
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &70308037155140 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 2.8.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70308037155140
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: bundler
|
60
|
-
requirement: &
|
60
|
+
requirement: &70308037154620 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.0.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70308037154620
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jeweler
|
71
|
-
requirement: &
|
71
|
+
requirement: &70308037154140 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.8.3
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70308037154140
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: ZenTest
|
82
|
-
requirement: &
|
82
|
+
requirement: &70308037153620 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 4.6.2
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70308037153620
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: autotest-growl
|
93
|
-
requirement: &
|
93
|
+
requirement: &70308037153100 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 0.2.16
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70308037153100
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: jsmin
|
104
|
-
requirement: &
|
104
|
+
requirement: &70308037152580 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70308037152580
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: fssm
|
115
|
-
requirement: &
|
115
|
+
requirement: &70308037152080 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :runtime
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70308037152080
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: sprockets
|
126
|
-
requirement: &
|
126
|
+
requirement: &70308037151600 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - =
|
@@ -131,7 +131,7 @@ dependencies:
|
|
131
131
|
version: 1.0.2
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70308037151600
|
135
135
|
description: Architecture.js helps you generate scaffolding, manage third-party packages,
|
136
136
|
compile, and compress your application.
|
137
137
|
email: daytonn@gmail.com
|
@@ -167,26 +167,31 @@ files:
|
|
167
167
|
- spec/cli_spec.rb
|
168
168
|
- spec/command_spec.rb
|
169
169
|
- spec/fixtures/.DS_Store
|
170
|
+
- spec/fixtures/_hidden.js
|
170
171
|
- spec/fixtures/compiled_src.js
|
171
172
|
- spec/fixtures/compressed.architecture
|
172
173
|
- spec/fixtures/compressed.js
|
173
174
|
- spec/fixtures/ejs.ejs
|
174
175
|
- spec/fixtures/existing.architecture
|
175
176
|
- spec/fixtures/lib1.js
|
177
|
+
- spec/fixtures/lib1_compressed.js
|
176
178
|
- spec/fixtures/lib2.js
|
179
|
+
- spec/fixtures/lib2_compressed.js
|
177
180
|
- spec/fixtures/myapp.architecture
|
178
181
|
- spec/fixtures/src_file.js
|
179
182
|
- spec/fixtures/templates/test_template_one.js
|
180
183
|
- spec/fixtures/templates/test_template_two.js
|
181
184
|
- spec/fixtures/test_template_options.js
|
182
185
|
- spec/fixtures/test_template_two.js
|
186
|
+
- spec/fixtures/update.architecture
|
187
|
+
- spec/fixtures/update.js
|
183
188
|
- spec/generator_spec.rb
|
184
189
|
- spec/helpers_spec.rb
|
185
190
|
- spec/notification_spec.rb
|
186
191
|
- spec/project_spec.rb
|
187
192
|
- spec/spec_helper.rb
|
188
193
|
- templates/blank.js
|
189
|
-
homepage:
|
194
|
+
homepage: https://github.com/daytonn/architecture-js
|
190
195
|
licenses:
|
191
196
|
- MIT
|
192
197
|
post_install_message:
|
@@ -201,7 +206,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
206
|
version: '0'
|
202
207
|
segments:
|
203
208
|
- 0
|
204
|
-
hash:
|
209
|
+
hash: 3452299829619871935
|
205
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
211
|
none: false
|
207
212
|
requirements:
|