architecture-js 0.5.5 → 0.5.6
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 +2 -1
- data/lib/.DS_Store +0 -0
- data/lib/architecture-js/architect.rb +46 -38
- data/lib/architecture-js/blueprint.rb +2 -2
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.6
|
data/architecture-js.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "architecture-js"
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.6"
|
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"]
|
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
|
|
33
33
|
"architecture-js.gemspec",
|
34
34
|
"bin/architect",
|
35
35
|
"docs/docco.css",
|
36
|
+
"lib/.DS_Store",
|
36
37
|
"lib/architecture-js.rb",
|
37
38
|
"lib/architecture-js/architect.rb",
|
38
39
|
"lib/architecture-js/blueprint.rb",
|
data/lib/.DS_Store
ADDED
Binary file
|
@@ -71,15 +71,19 @@ module Architect
|
|
71
71
|
begin
|
72
72
|
@project.generator.generate config
|
73
73
|
rescue Exception => e
|
74
|
-
puts e.message
|
74
|
+
puts ArchitectureJS::Notification.error e.message
|
75
75
|
templates
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
79
|
def compile
|
80
|
-
|
81
|
-
|
82
|
-
|
80
|
+
begin
|
81
|
+
@project = ArchitectureJS::Blueprint.new_from_config(@root)
|
82
|
+
compress = @options[:c] || @options[:compress]
|
83
|
+
@project.update(compress)
|
84
|
+
rescue Exception => e
|
85
|
+
puts ArchitectureJS::Notification.error e.message
|
86
|
+
end
|
83
87
|
end
|
84
88
|
|
85
89
|
def watch
|
@@ -92,7 +96,7 @@ module Architect
|
|
92
96
|
|
93
97
|
def templates
|
94
98
|
@project = ArchitectureJS::Blueprint.new_from_config(@root)
|
95
|
-
puts "
|
99
|
+
puts "Templates:"
|
96
100
|
@project.generator.templates.each { |k,v| puts " - #{k}" }
|
97
101
|
end
|
98
102
|
|
@@ -109,40 +113,32 @@ module Architect
|
|
109
113
|
while not command =~ /^quit$/
|
110
114
|
print ArchitectureJS::Notification.prompt
|
111
115
|
command = gets.chomp
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
parse_generate_options
|
131
|
-
self.send @command
|
132
|
-
rescue Exception => e
|
133
|
-
puts e.message
|
134
|
-
puts "Available templates:"
|
135
|
-
@project.generator.templates.each { |k,v| puts " - #{k}" }
|
136
|
-
end
|
137
|
-
when /help/
|
138
|
-
puts 'Interactive commands:'
|
139
|
-
puts ' compile - compile the application'
|
140
|
-
puts ' generate - generate a template'
|
141
|
-
puts ' templates - list available templates to generate'
|
142
|
-
puts ' src_files - list source files to be compiled into the build_dir'
|
143
|
-
puts ' help - show this menu'
|
144
|
-
puts ' quit - stop watching for changes'
|
116
|
+
args = command.split(/\s/)
|
117
|
+
parse_command args
|
118
|
+
case @command
|
119
|
+
when /^quit$/
|
120
|
+
@watcher.stop
|
121
|
+
when /help/
|
122
|
+
puts 'Interactive commands:'
|
123
|
+
puts ' compile - compile the application'
|
124
|
+
puts ' generate - generate a template'
|
125
|
+
puts ' templates - list available templates to generate'
|
126
|
+
puts ' src_files - list source files to be compiled into the build_dir'
|
127
|
+
puts ' help - show this menu'
|
128
|
+
puts ' quit - stop watching for changes'
|
129
|
+
when /compile|generate|templates|src_files/
|
130
|
+
|
131
|
+
if @command == :generate
|
132
|
+
parse_arguments args
|
133
|
+
parse_generate_options args
|
145
134
|
else
|
135
|
+
args = args.drop 1
|
136
|
+
parse_interactive_options(args)
|
137
|
+
parse_arguments args
|
138
|
+
end
|
139
|
+
|
140
|
+
self.send @command
|
141
|
+
else
|
146
142
|
puts ArchitectureJS::Notification.error "Unrecognized command `#{command}`. Try `help` or `quit`."
|
147
143
|
end
|
148
144
|
end
|
@@ -152,6 +148,18 @@ module Architect
|
|
152
148
|
end
|
153
149
|
end
|
154
150
|
|
151
|
+
def parse_interactive_options(args = [])
|
152
|
+
@options = {}
|
153
|
+
|
154
|
+
args.each do |option|
|
155
|
+
case option
|
156
|
+
when /\-c|\-\-compress/
|
157
|
+
@options[:compress] = true
|
158
|
+
@options[:c] = true
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
155
163
|
def parse_options
|
156
164
|
@options = {}
|
157
165
|
OptionParser.new do |opts|
|
@@ -91,11 +91,11 @@ module ArchitectureJS
|
|
91
91
|
puts ArchitectureJS::Notification.added "#{@config[:src_dir]}/#{@config[:name]}.js created"
|
92
92
|
end
|
93
93
|
|
94
|
-
def update
|
94
|
+
def update(compress = false)
|
95
95
|
read_config
|
96
96
|
get_src_files
|
97
97
|
compile_src_files
|
98
|
-
compress_application if @config[:output] == 'compressed'
|
98
|
+
compress_application if compress || @config[:output] == 'compressed'
|
99
99
|
puts ArchitectureJS::Notification.log "application updated" unless @errors
|
100
100
|
@errors = false
|
101
101
|
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.5.
|
4
|
+
version: 0.5.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- architecture-js.gemspec
|
149
149
|
- bin/architect
|
150
150
|
- docs/docco.css
|
151
|
+
- lib/.DS_Store
|
151
152
|
- lib/architecture-js.rb
|
152
153
|
- lib/architecture-js/architect.rb
|
153
154
|
- lib/architecture-js/blueprint.rb
|
@@ -242,7 +243,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
242
243
|
version: '0'
|
243
244
|
segments:
|
244
245
|
- 0
|
245
|
-
hash:
|
246
|
+
hash: -4246046546828477172
|
246
247
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
247
248
|
none: false
|
248
249
|
requirements:
|