architecture-js 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.7
1
+ 0.5.8
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "architecture-js"
8
- s.version = "0.5.7"
8
+ s.version = "0.5.8"
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"]
@@ -87,8 +87,7 @@ module Architect
87
87
  def watch
88
88
  @project = ArchitectureJS::Blueprint.new_from_config(@root)
89
89
  @project.update
90
- @watcher = @project.watch
91
- puts ArchitectureJS::Notification.log "architect is watching for changes. Type 'quit' to stop."
90
+ @watcher = @project.watch("architect is watching for changes. Type 'quit' to stop.")
92
91
  start_interactive_session
93
92
  rescue Exception => e
94
93
  puts ArchitectureJS::Notification.error e.message
@@ -112,12 +111,12 @@ module Architect
112
111
 
113
112
  private
114
113
  def start_interactive_session
115
- command = ''
114
+ @command = ''
116
115
 
117
- while not command =~ /^quit$/
116
+ while not @command =~ /^quit$/
118
117
  print ArchitectureJS::Notification.prompt
119
- command = gets.chomp
120
- args = command.split(/\s/)
118
+ @command = gets.chomp
119
+ args = @command.split(/\s/)
121
120
  parse_command args
122
121
 
123
122
  case @command
@@ -132,13 +131,12 @@ module Architect
132
131
  puts ' help - show this menu'
133
132
  puts ' quit - stop watching for changes'
134
133
  when /compile|generate|templates|src_files/
135
-
136
134
  if @command == :generate
137
135
  parse_arguments args
138
- parse_generate_options args
136
+ parse_generate_options
139
137
  else
140
138
  args = args.drop 1
141
- parse_interactive_options(args)
139
+ parse_interactive_options args
142
140
  parse_arguments args
143
141
  end
144
142
 
@@ -160,9 +160,9 @@ module ArchitectureJS
160
160
  end
161
161
  end
162
162
 
163
- def watch
163
+ def watch(message)
164
164
  watcher = ArchitectureJS::Watcher.new self
165
- watcher.watch
165
+ watcher.watch message
166
166
  end
167
167
 
168
168
  end # class Blueprint
@@ -6,8 +6,8 @@ module ArchitectureJS
6
6
  def initialize(project)
7
7
  @project = project
8
8
  @listener = Listen.to(@project.root)
9
- @listener.ignore(/#{@project.config[:build_dir]}|spec|test/)
10
- .filter(/\.jst?$/)
9
+ @listener.ignore(/#{@project.config[:build_dir]}/)
10
+ .filter(/\.jst?$|\.blueprint$/)
11
11
  .change do |modified, added, removed|
12
12
  update_files(modified, "modified") if modified.length > 0
13
13
  update_files(added, "added") if added.length > 0
@@ -15,8 +15,9 @@ module ArchitectureJS
15
15
  end
16
16
  end
17
17
 
18
- def watch
18
+ def watch(message = false)
19
19
  @listener.start(false)
20
+ puts ArchitectureJS::Notification.log message if message
20
21
  self
21
22
  end
22
23
 
@@ -30,8 +31,7 @@ module ArchitectureJS
30
31
  files.each do |f|
31
32
  f = File.basename f
32
33
  if action == "deleted"
33
- FileUtils.rm_rf("#{@project.root}/#{f}")
34
- puts "remove #{@project.root}/#{f}"
34
+ FileUtils.rm_rf("#{@project.root}/#{@project.config[:build_dir]}/#{f}") if File.exists? "#{@project.root}/#{@project.config[:build_dir]}/#{f}"
35
35
  end
36
36
 
37
37
  puts "\n" << ArchitectureJS::Notification.event("#{f} was #{action}")
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.7
4
+ version: 0.5.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -243,7 +243,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
243
243
  version: '0'
244
244
  segments:
245
245
  - 0
246
- hash: -735876747371210409
246
+ hash: 3997393681716254954
247
247
  required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  none: false
249
249
  requirements: