flok 0.0.29 → 0.0.30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 814b9ab5667695a4b37509a02cb109d34b492017
4
- data.tar.gz: 8e1abadd518096d523acd3ed37adc0b22e1b87e2
3
+ metadata.gz: 661e0b19172ad38ef6b674a5aa2d7c01e3ccb751
4
+ data.tar.gz: a80a48d481a2d2fcb12569e51aa51b8ab2c9756b
5
5
  SHA512:
6
- metadata.gz: 50d39d48772d80a9fa82df7d687eeaa2a17270be8398777345ae9e1a2d1c9afc3f594044c9ab6de9c43db3de7c73b5481ab5f73df7fbdcb5e3fca9856d493962
7
- data.tar.gz: 959c40b892fddfc36f7b0633b8498eb04a1427493bd6da5fa8a1db937a2258f6d1f262a95428746a318d208dd0d400c2a2f8aa9f053a86be408f6fa1d7d5b3e5
6
+ metadata.gz: c4a955b189a9287995e4c8d9cfc42a2fc7e9e07297c68f37fe0f6e665dd60f571e37caee341d97c5e0cedc8e9a358a21a73b6f0f28061ed244de8b84190cf11c
7
+ data.tar.gz: 9257c0090b03557b5d7ea2345c23aec9194715d3b79aaeb3f1a878d146f1da7ac7fc6193cf9cfb8b80a8f8fb7abc735f691c6d752b9f8d60bb45569dc4bd65ad
data/lib/flok/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Flok
2
- VERSION = "0.0.29"
2
+ VERSION = "0.0.30"
3
3
  end
data/spec/env/kern.rb CHANGED
@@ -34,7 +34,7 @@ shared_context "kern" do
34
34
  File.write './app/controllers/user_controller.rb', user_controllers_src
35
35
 
36
36
  #Build
37
- flok "build chrome" #Will generate drivers/ but we will ignore that
37
+ flok "build" #Will generate drivers/ but we will ignore that
38
38
 
39
39
  #Execute
40
40
  @driver = FakeDriverContext.new
data/spec/etc/cli_spec.rb CHANGED
@@ -41,11 +41,8 @@ RSpec.describe "CLI" do
41
41
  end
42
42
 
43
43
  it "Can be executed via bundle exec" do
44
- Flok.platforms.each do |platform|
45
- ENV['PLATFORM'] = platform
46
- flok_new do
47
- flok "build"
48
- end
44
+ flok_new do
45
+ flok "build"
49
46
  end
50
47
  end
51
48
 
@@ -67,31 +64,29 @@ it "Can create a new project with correct directories" do
67
64
  end
68
65
 
69
66
  it "Can build a project with every type of platform" do
70
- Flok.platforms.each do |platform|
71
- ENV['PLATFORM'] = platform
72
- flok_new do
73
- #Build a new project
74
- flok "build"
75
-
76
- #Check it's products directory
77
- expect(dirs).to include "products"
78
- Dir.chdir "products" do
79
- #Has a platform folder
80
- expect(dirs).to include platform
81
- Dir.chdir platform do
82
- #Has an application_user.js file
83
- expect(files).to include "application_user.js"
84
-
85
- #The application_user.js contains both the glob/application.js and the glob/user_compiler.js
86
- glob_application_js = File.read('glob/application.js')
87
- glob_user_compiler_js = File.read('glob/user_compiler.js')
88
- application_user_js = File.read('application_user.js')
89
- expect(application_user_js).to include(glob_application_js)
90
- expect(application_user_js).to include(glob_user_compiler_js)
91
-
92
- #Contains the same files as the kernel in the drivers directory
93
- expect(dirs).to include "drivers"
94
- end
67
+ platform = ENV['PLATFORM']
68
+ flok_new do
69
+ #Build a new project
70
+ flok "build"
71
+
72
+ #Check it's products directory
73
+ expect(dirs).to include "products"
74
+ Dir.chdir "products" do
75
+ #Has a platform folder
76
+ expect(dirs).to include platform
77
+ Dir.chdir platform do
78
+ #Has an application_user.js file
79
+ expect(files).to include "application_user.js"
80
+
81
+ #The application_user.js contains both the glob/application.js and the glob/user_compiler.js
82
+ glob_application_js = File.read('glob/application.js')
83
+ glob_user_compiler_js = File.read('glob/user_compiler.js')
84
+ application_user_js = File.read('application_user.js')
85
+ expect(application_user_js).to include(glob_application_js)
86
+ expect(application_user_js).to include(glob_user_compiler_js)
87
+
88
+ #Contains the same files as the kernel in the drivers directory
89
+ expect(dirs).to include "drivers"
95
90
  end
96
91
  end
97
92
  end
@@ -122,45 +117,41 @@ it "Can create a new project with correct directories" do
122
117
  end
123
118
  end
124
119
 
125
- Flok.platforms.each do |platform|
126
- ENV['PLATFORM'] = platform
127
- @platform = platform
128
- controller_rb = File.read('./spec/etc/user_compiler/controller0.rb')
120
+ platform = ENV['PLATFORM']
121
+ @platform = platform
122
+ controller_rb = File.read('./spec/etc/user_compiler/controller0.rb')
129
123
 
130
- #The file with content should be longer when compiled into the flat application_user.js
131
- len_with_content = compile_with_file "./spec/etc/user_compiler/controller0.rb"
132
- len_no_content = compile_with_file
124
+ #The file with content should be longer when compiled into the flat application_user.js
125
+ len_with_content = compile_with_file "./spec/etc/user_compiler/controller0.rb"
126
+ len_no_content = compile_with_file
133
127
 
134
- expect(len_no_content).to be < len_with_content
135
- end
128
+ expect(len_no_content).to be < len_with_content
136
129
  end
137
130
 
138
- include SpecHelpers
139
- it "server does build project when first run" do
140
- Flok.platforms.each do |platform|
141
- ENV['PLATFORM'] = platform
142
- flok_new do
143
- #Now execute the command with a set of arguments
144
- sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
145
- #The server should always trigger a build on it's first run
146
- expect(dirs).to include "products"
147
- Dir.chdir "products" do
148
- #Has a platform folder
149
- expect(dirs).to include platform
150
- Dir.chdir platform do
151
- #Has an application_user.js file
152
- expect(files).to include "application_user.js"
153
-
154
- #The application_user.js contains both the glob/application.js and the glob/user_compiler.js
155
- glob_application_js = File.read('glob/application.js')
156
- glob_user_compiler_js = File.read('glob/user_compiler.js')
157
- application_user_js = File.read('application_user.js')
158
- expect(application_user_js).to include(glob_application_js)
159
- expect(application_user_js).to include(glob_user_compiler_js)
160
-
161
- #Contains the same files as the kernel in the drivers directory
162
- expect(dirs).to include "drivers"
163
- end
131
+ include SpecHelpers
132
+ it "server does build project when first run" do
133
+ platform = ENV['PLATFORM']
134
+ flok_new do
135
+ #Now execute the command with a set of arguments
136
+ sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
137
+ #The server should always trigger a build on it's first run
138
+ expect(dirs).to include "products"
139
+ Dir.chdir "products" do
140
+ #Has a platform folder
141
+ expect(dirs).to include platform
142
+ Dir.chdir platform do
143
+ #Has an application_user.js file
144
+ expect(files).to include "application_user.js"
145
+
146
+ #The application_user.js contains both the glob/application.js and the glob/user_compiler.js
147
+ glob_application_js = File.read('glob/application.js')
148
+ glob_user_compiler_js = File.read('glob/user_compiler.js')
149
+ application_user_js = File.read('application_user.js')
150
+ expect(application_user_js).to include(glob_application_js)
151
+ expect(application_user_js).to include(glob_user_compiler_js)
152
+
153
+ #Contains the same files as the kernel in the drivers directory
154
+ expect(dirs).to include "drivers"
164
155
  end
165
156
  end
166
157
  end
@@ -168,86 +159,80 @@ it "Can create a new project with correct directories" do
168
159
  end
169
160
 
170
161
  it "server does rebuild project when a file is added" do
171
- Flok.platforms.each do |platform|
172
- ENV['PLATFORM'] = platform
173
- flok_new do
174
- #Now execute the command with a set of arguments
175
- sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
176
- #Get the original build
177
- application_user_js = File.read("products/#{platform}/application_user.js")
178
-
179
- #Now add a file
180
- File.write "./app/controllers/test2.rb", %{
181
- controller "my_controller" do
182
- view "my_controller"
183
- action "my_action" do
184
- on_entry %{
185
- }
186
- end
162
+ platform = ENV['PLATFORM']
163
+ flok_new do
164
+ #Now execute the command with a set of arguments
165
+ sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
166
+ #Get the original build
167
+ application_user_js = File.read("products/#{platform}/application_user.js")
168
+
169
+ #Now add a file
170
+ File.write "./app/controllers/test2.rb", %{
171
+ controller "my_controller" do
172
+ view "my_controller"
173
+ action "my_action" do
174
+ on_entry %{
175
+ }
187
176
  end
188
- }
177
+ end
178
+ }
189
179
 
190
- #Wait for a rebuild
191
- expect(out).to readline_and_equal_x_within_y_seconds("BUILD RAN", 5.seconds)
180
+ #Wait for a rebuild
181
+ expect(out).to readline_and_equal_x_within_y_seconds("BUILD RAN", 5.seconds)
192
182
 
193
- #Get updated version
194
- application_user_js2 = File.read("products/#{platform}/application_user.js")
183
+ #Get updated version
184
+ application_user_js2 = File.read("products/#{platform}/application_user.js")
195
185
 
196
- #Make sure the compiled file is different and it's somewhat valid (length > 30)
197
- expect(application_user_js2).not_to eq(application_user_js)
198
- expect(application_user_js2.length).to be > 30 #Magic 30 to avoid any problems
199
- end
186
+ #Make sure the compiled file is different and it's somewhat valid (length > 30)
187
+ expect(application_user_js2).not_to eq(application_user_js)
188
+ expect(application_user_js2.length).to be > 30 #Magic 30 to avoid any problems
200
189
  end
201
190
  end
202
191
  end
203
192
 
204
193
  it "server does host products on localhost:9992" do
205
- Flok.platforms.each do |platform|
206
- ENV['PLATFORM'] = platform
207
- flok_new do
208
- #Now execute the command with a set of arguments
209
- sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
210
- real_application_user_js = File.read("products/#{platform}/application_user.js")
211
-
212
- #Grab the application_user.js file
213
- res = wget "http://localhost:9992/application_user.js"
214
- expect(res).not_to eq(nil)
215
- expect(res.length).not_to eq(0)
216
- expect(res).to eq(real_application_user_js)
217
- end
194
+ platform = ENV['PLATFORM']
195
+ flok_new do
196
+ #Now execute the command with a set of arguments
197
+ sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
198
+ real_application_user_js = File.read("products/#{platform}/application_user.js")
199
+
200
+ #Grab the application_user.js file
201
+ res = wget "http://localhost:9992/application_user.js"
202
+ expect(res).not_to eq(nil)
203
+ expect(res.length).not_to eq(0)
204
+ expect(res).to eq(real_application_user_js)
218
205
  end
219
206
  end
220
207
  end
221
208
 
222
209
  it "server does host products on localhost:9992 and changes the products when the files change" do
223
- Flok.platforms.each do |platform|
224
- ENV['PLATFORM'] = platform
225
- flok_new do
226
- #Now execute the command with a set of arguments
227
- sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
228
- #Get the original
229
- application_user_js = wget "http://localhost:9992/application_user.js"
230
-
231
- #Now add a file
232
- File.write "./app/controllers/test2.rb", %{
233
- controller "my_controller" do
234
- view "my_controller"
235
- action "my_action" do
236
- on_entry %{
237
- }
238
- end
210
+ platform = ENV['PLATFORM']
211
+ flok_new do
212
+ #Now execute the command with a set of arguments
213
+ sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
214
+ #Get the original
215
+ application_user_js = wget "http://localhost:9992/application_user.js"
216
+
217
+ #Now add a file
218
+ File.write "./app/controllers/test2.rb", %{
219
+ controller "my_controller" do
220
+ view "my_controller"
221
+ action "my_action" do
222
+ on_entry %{
223
+ }
239
224
  end
240
- }
241
- #Wait for a rebuild
242
- expect(out).to readline_and_equal_x_within_y_seconds("BUILD RAN", 5.seconds)
225
+ end
226
+ }
227
+ #Wait for a rebuild
228
+ expect(out).to readline_and_equal_x_within_y_seconds("BUILD RAN", 5.seconds)
243
229
 
244
- #Grab new version
245
- application_user_js2 = wget "http://localhost:9992/application_user.js"
230
+ #Grab new version
231
+ application_user_js2 = wget "http://localhost:9992/application_user.js"
246
232
 
247
- #Make sure the compiled file is different and it's longer
248
- expect(application_user_js2.length).to be > application_user_js.length
249
- expect(application_user_js2.length).to be > 30 #Make sure it's at least something
250
- end
233
+ #Make sure the compiled file is different and it's longer
234
+ expect(application_user_js2.length).to be > application_user_js.length
235
+ expect(application_user_js2.length).to be > 30 #Make sure it's at least something
251
236
  end
252
237
  end
253
238
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flok
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - seo