flok 0.0.25 → 0.0.26

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: 5669e310a252edccf7e248ce60fda2ae16d468b8
4
- data.tar.gz: 6adb674423cdc76cae2b03ed5f9646c789b57b2f
3
+ metadata.gz: dd816948767d1fa84885249c917195471b4a4697
4
+ data.tar.gz: 3d873f4ad8b3f089cb6a62cefd5b299f065b3802
5
5
  SHA512:
6
- metadata.gz: 342041923b3ea89cb69a0eb53e741203301ed9a4657b5e33d207192b84b95ae9a764320fea2296428fadb4fbc8bcf85a8f0c5573aaca51440928447f8875bb8c
7
- data.tar.gz: e7f5c98d44bf066a3ba86f79f82776491383a54f7de056ee075255fc02db60089b5d678c308eb150582c1f1698b0afe973a8b3e38f497a344537a65befcc02fb
6
+ metadata.gz: 07ef018205e1e8d48327ed5a70b61bdcb7aade46f3cb966a1c4f5b93371443622875187d40798b5ee4ea1f3372ac4fad141cd0753843cc3f43b9b5c454420917
7
+ data.tar.gz: bb8172652f906c8e2810d6621f7ddb9231e9044c0b27a4248c7fccc82c736aa263ef1284e6a96e21420b3d5b3a6489ef7e50a86b37c907ee869ae2732850f715
data/bin/flok CHANGED
@@ -18,13 +18,14 @@ class FlokCLI < Thor
18
18
  end
19
19
  end
20
20
 
21
- desc "build <platform>", "Build the products for a platform"
22
- def build platform
21
+ desc "build", "Build the products for a platform"
22
+ def build
23
+ raise "$PLATFORM was not set" unless ENV['PLATFORM']
24
+ platform = ENV['PLATFORM']
25
+
23
26
  #Create a products folder if it dosen't already exist
24
27
  Dir.mkdir("./products") unless File.exists?("./products")
25
28
 
26
- ENV["PLATFORM"] = platform
27
-
28
29
  #Go into the flok gem project
29
30
  local_products_path = File.join(Dir.pwd, "products")
30
31
  Dir.chdir(File.join(File.dirname(__FILE__), "../")) do
@@ -65,8 +66,10 @@ class FlokCLI < Thor
65
66
 
66
67
  desc "server", "Monitors for changes within your flok application and triggers an automatic rebuild of ./products/* for a PLATFORM when something in ./app changes"
67
68
  include SpecHelpers #Contains sh2
68
- def server platform
69
- ENV['PLATFORM'] = platform
69
+ def server
70
+ raise "$PLATFORM was not set" unless ENV['PLATFORM']
71
+ platform = ENV['PLATFORM']
72
+
70
73
  #Ensure puts does something because it's on another thread
71
74
  $stdout.sync = true
72
75
 
@@ -111,5 +114,3 @@ class FlokCLI < Thor
111
114
  end
112
115
 
113
116
  FlokCLI.start(ARGV)
114
-
115
-
@@ -2,11 +2,11 @@
2
2
  Flok is divided up like rails. There is the flok kernel and driver stack and then there is user-facing applications.
3
3
 
4
4
  ###The flok command
5
- You create and build projects via the `flok` command.
5
+ You create and build projects via the `flok` command. You must set the `$FLOK_ENV` to either `DEBUG` or `RELEASE` and `$PLATFORM` to a platform.
6
6
 
7
7
  * `flok new <path>` - Create a new flok project
8
- * `flok build <platform>` - Build a flok project. Generates files in `./products`
9
- * `flok server <platform>` - Trigger auto-rebuild when a file is modified in the `./app` folder and hosts the `products/$PLATFORM` folder on `http://localhost:9992/`. e.g. `http://localhost:9992/application_user.js`
8
+ * `flok build` - Build a flok project. Generates files in `./products`
9
+ * `flok server` - Trigger auto-rebuild when a file is modified in the `./app` folder and hosts the `products/$PLATFORM` folder on `http://localhost:9992/`. e.g. `http://localhost:9992/application_user.js`
10
10
 
11
11
  ###Folder structure
12
12
  * `app/`
@@ -1,3 +1,3 @@
1
1
  module Flok
2
- VERSION = "0.0.25"
2
+ VERSION = "0.0.26"
3
3
  end
@@ -42,8 +42,9 @@ RSpec.describe "CLI" do
42
42
 
43
43
  it "Can be executed via bundle exec" do
44
44
  Flok.platforms.each do |platform|
45
+ ENV['PLATFORM'] = platform
45
46
  flok_new do
46
- flok "build #{platform}"
47
+ flok "build"
47
48
  end
48
49
  end
49
50
  end
@@ -172,6 +173,7 @@ it "Can create a new project with correct directories" do
172
173
 
173
174
  it "server does rebuild project when a file is added" do
174
175
  Flok.platforms.each do |platform|
176
+ ENV['PLATFORM'] = platform
175
177
  flok_new do
176
178
  #Start the server
177
179
  #Get path to the flok binary relative to this file
@@ -179,7 +181,7 @@ it "Can create a new project with correct directories" do
179
181
  lib_path = File.join(File.dirname(__FILE__), "../../lib")
180
182
 
181
183
  #Now execute the command with a set of arguments
182
- sh2("bundle exec flok server #{platform}", /BUILD RAN/) do |inp, out|
184
+ sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
183
185
  #Get the original build
184
186
  application_user_js = File.read("products/#{platform}/application_user.js")
185
187
 
@@ -210,6 +212,7 @@ it "Can create a new project with correct directories" do
210
212
 
211
213
  it "server does host products on localhost:9992" do
212
214
  Flok.platforms.each do |platform|
215
+ ENV['PLATFORM'] = platform
213
216
  flok_new do
214
217
  #Start the server
215
218
  #Get path to the flok binary relative to this file
@@ -217,7 +220,7 @@ it "Can create a new project with correct directories" do
217
220
  lib_path = File.join(File.dirname(__FILE__), "../../lib")
218
221
 
219
222
  #Now execute the command with a set of arguments
220
- sh2("bundle exec flok server #{platform}", /BUILD RAN/) do |inp, out|
223
+ sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
221
224
  real_application_user_js = File.read("products/#{platform}/application_user.js")
222
225
 
223
226
  #Grab the application_user.js file
@@ -230,6 +233,7 @@ it "Can create a new project with correct directories" do
230
233
 
231
234
  it "server does host products on localhost:9992 and changes the products when the files change" do
232
235
  Flok.platforms.each do |platform|
236
+ ENV['PLATFORM'] = platform
233
237
  flok_new do
234
238
  #Start the server
235
239
  #Get path to the flok binary relative to this file
@@ -237,7 +241,7 @@ it "Can create a new project with correct directories" do
237
241
  lib_path = File.join(File.dirname(__FILE__), "../../lib")
238
242
 
239
243
  #Now execute the command with a set of arguments
240
- sh2("bundle exec flok server #{platform}", /BUILD RAN/) do |inp, out|
244
+ sh2("bundle exec flok server", /BUILD RAN/) do |inp, out|
241
245
  #Get the original
242
246
  application_user_js = wget "http://localhost:9992/application_user.js"
243
247
 
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.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - seo