architecture-js 0.5.1 → 0.5.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/architect.rb +17 -10
- data/lib/architecture-js/watcher.rb +3 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
data/architecture-js.gemspec
CHANGED
@@ -93,14 +93,14 @@ module Architect
|
|
93
93
|
|
94
94
|
project = ArchitectureJS::Blueprint::new_from_config(path)
|
95
95
|
project.update
|
96
|
-
|
96
|
+
watcher = project.watch
|
97
97
|
puts ArchitectureJS::Notification.log "architect is watching for changes. Type 'quit' or 'exit' to stop."
|
98
|
-
start_interactive_session
|
98
|
+
start_interactive_session watcher
|
99
99
|
end
|
100
100
|
#watch
|
101
101
|
|
102
102
|
private
|
103
|
-
def start_interactive_session(
|
103
|
+
def start_interactive_session(watcher)
|
104
104
|
begin
|
105
105
|
command = ''
|
106
106
|
while not command =~ /exit|quit/
|
@@ -108,14 +108,14 @@ module Architect
|
|
108
108
|
command = gets.chomp
|
109
109
|
case command
|
110
110
|
when /exit|quit/
|
111
|
-
|
111
|
+
watcher.stop
|
112
112
|
when /src_files/
|
113
|
-
puts project.src_files.join("\n")
|
113
|
+
puts watcher.project.src_files.join("\n")
|
114
114
|
when /templates/
|
115
|
-
project.generator.templates.each { |k,v| puts k }
|
116
|
-
when /compile
|
115
|
+
watcher.project.generator.templates.each { |k,v| puts k }
|
116
|
+
when /compile/
|
117
117
|
begin
|
118
|
-
project.update
|
118
|
+
watcher.project.update
|
119
119
|
rescue Exception => e
|
120
120
|
puts e.message
|
121
121
|
ArchitectureJS::Notification.prompt
|
@@ -130,14 +130,21 @@ module Architect
|
|
130
130
|
rescue Exception => e
|
131
131
|
puts e.message
|
132
132
|
puts "Available templates:"
|
133
|
-
project.generator.templates.each { |k,v| puts " - #{k}" }
|
133
|
+
watcher.project.generator.templates.each { |k,v| puts " - #{k}" }
|
134
134
|
ArchitectureJS::Notification.prompt
|
135
135
|
end
|
136
|
+
when /help/
|
137
|
+
puts 'Interactive commands:'
|
138
|
+
puts ' compile - compile the application'
|
139
|
+
puts ' generate - generate a template'
|
140
|
+
puts ' templates - list available templates to generate'
|
141
|
+
puts ' src_files - list source files to be compiled into the build_dir'
|
142
|
+
puts ' help - show this menu'
|
136
143
|
end
|
137
144
|
end
|
138
145
|
rescue SystemExit, Interrupt
|
139
146
|
puts
|
140
|
-
|
147
|
+
watcher.stop
|
141
148
|
end
|
142
149
|
end
|
143
150
|
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module ArchitectureJS
|
2
2
|
class Watcher
|
3
3
|
|
4
|
+
attr_accessor :project, :listener
|
5
|
+
|
4
6
|
def initialize(project)
|
5
7
|
@project = project
|
6
8
|
@listener = Listen.to(@project.root)
|
@@ -15,7 +17,7 @@ module ArchitectureJS
|
|
15
17
|
|
16
18
|
def watch
|
17
19
|
@listener.start(false)
|
18
|
-
|
20
|
+
self
|
19
21
|
end
|
20
22
|
|
21
23
|
private
|
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.2
|
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: 3798563733388663936
|
246
246
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
247
247
|
none: false
|
248
248
|
requirements:
|