architecture-js 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.8
1
+ 0.1.9
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "architecture-js"
8
- s.version = "0.1.8"
8
+ s.version = "0.1.9"
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"]
@@ -2,16 +2,20 @@ module ArchitectureJS
2
2
  module Command
3
3
  def watch(path = nil)
4
4
  require "fssm"
5
-
6
- path ||= File.expand_path(Dir.getwd)
5
+ path ||= Dir.getwd
6
+ path = File.expand_path(path)
7
7
 
8
8
  puts ArchitectureJS::Notification.log "ArchitectureJS are watching for changes. Press Ctrl-C to stop."
9
9
  project = ArchitectureJS::Project::new_from_config(path)
10
10
  project.update
11
11
  watch_hash = Hash.new
12
+ watch_files = Dir["#{path}/**/"]
13
+ watch_files.shift # remove the project root
14
+ # remove the build_dir
15
+ watch_files.reject! { |dir| dir.match(/#{path}\/#{project.config[:build_dir]}/) }
12
16
 
13
- project.watch_directories.each do |dir|
14
- watch_hash["#{path}/#{dir}"] = "**/*.js"
17
+ watch_files.each do |dir|
18
+ watch_hash[dir] = "**/*.js"
15
19
  end
16
20
 
17
21
  watch_hash[path] = "**/*.architecture"
@@ -32,6 +36,11 @@ module ArchitectureJS
32
36
  puts ArchitectureJS::Notification.event "#{relative} created"
33
37
  project.update
34
38
  end
39
+
40
+ delete do |base, relative|
41
+ puts ArchitectureJS::Notification.event "#{relative} deleted"
42
+ project.update
43
+ end
35
44
  end
36
45
  end
37
46
  end
@@ -4,7 +4,6 @@ module ArchitectureJS
4
4
  :src_files,
5
5
  :framework,
6
6
  :config_name,
7
- :watch_directories,
8
7
  :directories,
9
8
  :template_directories,
10
9
  :generator,
@@ -33,7 +32,6 @@ module ArchitectureJS
33
32
  @root = File.expand_path(root)
34
33
  @template_directories = ["#{ArchitectureJS::BASE_DIR}/templates", "#{@root}/templates"]
35
34
  @directories = ['lib', 'src']
36
- @watch_directories = ['src']
37
35
  @src_files = Array.new
38
36
  @config = {
39
37
  framework: 'none',
data/spec/command_spec.rb CHANGED
@@ -32,20 +32,21 @@ describe ArchitectureJS::Command do
32
32
  end
33
33
 
34
34
  context 'Usage' do
35
+ before :each do
36
+ suppress_output { ArchitectureJS::Command.create({ name: 'myapp', root: TMP_DIR }) }
37
+ end
38
+
35
39
  after :each do
36
40
  FileUtils.rm_rf TMP_DIR
37
41
  end
38
42
 
39
43
  it 'should create a new application' do
40
- suppress_output { ArchitectureJS::Command.create({ name: 'myapp', root: TMP_DIR }) }
41
-
42
44
  "#{TMP_DIR}/myapp.architecture".should be_same_file_as "#{FIXTURES}/myapp.architecture"
43
45
  File.directory?("#{TMP_DIR}/lib").should be_true
44
46
  File.directory?("#{TMP_DIR}/src").should be_true
45
47
  end
46
48
 
47
49
  it 'should compile the application' do
48
- suppress_output { ArchitectureJS::Command.create({ name: 'myapp', root: TMP_DIR }) }
49
50
  FileUtils.cp "#{FIXTURES}/lib1.js", "#{TMP_DIR}/src/lib1.js"
50
51
  FileUtils.cp "#{FIXTURES}/lib2.js", "#{TMP_DIR}/src/lib2.js"
51
52
  FileUtils.cp "#{FIXTURES}/src_file.js", "#{TMP_DIR}/src/myapp.js"
@@ -55,6 +56,6 @@ describe ArchitectureJS::Command do
55
56
  File.exists?("#{TMP_DIR}/lib/myapp.js").should be_true
56
57
  "#{TMP_DIR}/lib/myapp.js".should be_same_file_as "#{FIXTURES}/compressed.js"
57
58
  end
58
-
59
+
59
60
  end # Usage
60
61
  end
data/spec/project_spec.rb CHANGED
@@ -42,10 +42,6 @@ describe ArchitectureJS::Project do
42
42
  @project.template_directories.should == ["#{ArchitectureJS::BASE_DIR}/templates", "#{TMP_DIR}/templates"]
43
43
  end
44
44
 
45
- it "should have a watch_directories array" do
46
- @project.watch_directories.should == ['src']
47
- end
48
-
49
45
  it "should have a generator" do
50
46
  @project.generator.should_not be_nil
51
47
  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.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-30 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fssm
16
- requirement: &70207780254600 !ruby/object:Gem::Requirement
16
+ requirement: &70185748933780 !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: *70207780254600
24
+ version_requirements: *70185748933780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jsmin
27
- requirement: &70207780254040 !ruby/object:Gem::Requirement
27
+ requirement: &70185748933240 !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: *70207780254040
35
+ version_requirements: *70185748933240
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sprockets
38
- requirement: &70207780253540 !ruby/object:Gem::Requirement
38
+ requirement: &70185748932720 !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: *70207780253540
46
+ version_requirements: *70185748932720
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &70207780253000 !ruby/object:Gem::Requirement
49
+ requirement: &70185748932240 !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: *70207780253000
57
+ version_requirements: *70185748932240
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bundler
60
- requirement: &70207780150620 !ruby/object:Gem::Requirement
60
+ requirement: &70185748931760 !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: *70207780150620
68
+ version_requirements: *70185748931760
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
- requirement: &70207780149980 !ruby/object:Gem::Requirement
71
+ requirement: &70185748922500 !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: *70207780149980
79
+ version_requirements: *70185748922500
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: ZenTest
82
- requirement: &70207780149500 !ruby/object:Gem::Requirement
82
+ requirement: &70185748921900 !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: *70207780149500
90
+ version_requirements: *70185748921900
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: autotest-growl
93
- requirement: &70207780149020 !ruby/object:Gem::Requirement
93
+ requirement: &70185748921300 !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: *70207780149020
101
+ version_requirements: *70185748921300
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: jsmin
104
- requirement: &70207780148460 !ruby/object:Gem::Requirement
104
+ requirement: &70185748920720 !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: *70207780148460
112
+ version_requirements: *70185748920720
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: fssm
115
- requirement: &70207780147960 !ruby/object:Gem::Requirement
115
+ requirement: &70185748920120 !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: *70207780147960
123
+ version_requirements: *70185748920120
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: sprockets
126
- requirement: &70207780147480 !ruby/object:Gem::Requirement
126
+ requirement: &70185748919520 !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: *70207780147480
134
+ version_requirements: *70185748919520
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
@@ -201,7 +201,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
201
201
  version: '0'
202
202
  segments:
203
203
  - 0
204
- hash: 3163777474536448183
204
+ hash: -1038575252978684242
205
205
  required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  none: false
207
207
  requirements: