architecture-js 0.5.0 → 0.5.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.
- data/VERSION +1 -1
- data/architecture-js.gemspec +1 -1
- data/lib/architecture-js/architect.rb +42 -35
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/architecture-js.gemspec
CHANGED
@@ -94,46 +94,53 @@ module Architect
|
|
94
94
|
project = ArchitectureJS::Blueprint::new_from_config(path)
|
95
95
|
project.update
|
96
96
|
listener = project.watch
|
97
|
-
|
98
|
-
command = 'start'
|
99
97
|
puts ArchitectureJS::Notification.log "architect is watching for changes. Type 'quit' or 'exit' to stop."
|
100
|
-
|
101
|
-
print ArchitectureJS::Notification.prompt
|
102
|
-
command = gets.chomp
|
103
|
-
case command
|
104
|
-
when /exit|quit/
|
105
|
-
listener.stop
|
106
|
-
when /src_files/
|
107
|
-
puts project.src_files.join("\n")
|
108
|
-
when /templates/
|
109
|
-
project.generator.templates.each { |k,v| puts k }
|
110
|
-
when /compile|update/
|
111
|
-
begin
|
112
|
-
project.update
|
113
|
-
rescue Exception => e
|
114
|
-
puts e.message
|
115
|
-
ArchitectureJS::Notification.prompt
|
116
|
-
end
|
117
|
-
when /generate/
|
118
|
-
begin
|
119
|
-
args = command.split(/\s/)
|
120
|
-
parse_command args
|
121
|
-
parse_arguments args
|
122
|
-
parse_generate_options
|
123
|
-
self.send @command
|
124
|
-
rescue Exception => e
|
125
|
-
puts e.message
|
126
|
-
puts "Available templates:"
|
127
|
-
project.generator.templates.each { |k,v| puts " - #{k}" }
|
128
|
-
ArchitectureJS::Notification.prompt
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
98
|
+
start_interactive_session listener
|
133
99
|
end
|
134
100
|
#watch
|
135
101
|
|
136
102
|
private
|
103
|
+
def start_interactive_session(listener)
|
104
|
+
begin
|
105
|
+
command = ''
|
106
|
+
while not command =~ /exit|quit/
|
107
|
+
print ArchitectureJS::Notification.prompt
|
108
|
+
command = gets.chomp
|
109
|
+
case command
|
110
|
+
when /exit|quit/
|
111
|
+
listener.stop
|
112
|
+
when /src_files/
|
113
|
+
puts project.src_files.join("\n")
|
114
|
+
when /templates/
|
115
|
+
project.generator.templates.each { |k,v| puts k }
|
116
|
+
when /compile|update/
|
117
|
+
begin
|
118
|
+
project.update
|
119
|
+
rescue Exception => e
|
120
|
+
puts e.message
|
121
|
+
ArchitectureJS::Notification.prompt
|
122
|
+
end
|
123
|
+
when /generate/
|
124
|
+
begin
|
125
|
+
args = command.split(/\s/)
|
126
|
+
parse_command args
|
127
|
+
parse_arguments args
|
128
|
+
parse_generate_options
|
129
|
+
self.send @command
|
130
|
+
rescue Exception => e
|
131
|
+
puts e.message
|
132
|
+
puts "Available templates:"
|
133
|
+
project.generator.templates.each { |k,v| puts " - #{k}" }
|
134
|
+
ArchitectureJS::Notification.prompt
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
rescue SystemExit, Interrupt
|
139
|
+
puts
|
140
|
+
listener.stop
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
137
144
|
def parse_options
|
138
145
|
@options = {}
|
139
146
|
OptionParser.new do |opts|
|
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.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -242,7 +242,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
242
242
|
version: '0'
|
243
243
|
segments:
|
244
244
|
- 0
|
245
|
-
hash:
|
245
|
+
hash: 2837071742649340263
|
246
246
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
247
247
|
none: false
|
248
248
|
requirements:
|