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 +4 -4
- data/bin/flok +9 -8
- data/docs/project.md +3 -3
- data/lib/flok/version.rb +1 -1
- data/spec/etc/cli_spec.rb +8 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd816948767d1fa84885249c917195471b4a4697
|
4
|
+
data.tar.gz: 3d873f4ad8b3f089cb6a62cefd5b299f065b3802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
22
|
-
def build
|
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
|
69
|
-
ENV['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
|
-
|
data/docs/project.md
CHANGED
@@ -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
|
9
|
-
* `flok server
|
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/`
|
data/lib/flok/version.rb
CHANGED
data/spec/etc/cli_spec.rb
CHANGED
@@ -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
|
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
|
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
|
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
|
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
|
|