flowcation 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/exe/flowcation +41 -40
- data/exe/flowcation_with_options +45 -0
- data/lib/flowcation.rb +1 -0
- data/lib/flowcation/assets.rb +7 -1
- data/lib/flowcation/settings.rb +1 -1
- data/lib/flowcation/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2e51ea8371dda9e9681420be1bf5952e652dca8
|
4
|
+
data.tar.gz: fa3c4f855cfd2c95a2cc2f526539ad8f9ec4bc8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d69ea6443345fadfd78c7cb30fd52ddffdeaad28642e2bb8cfb419899e16767a9cb4e7124384c857f1532cdb5e436bb2fad2ccf141e828b1f5a29698377731f
|
7
|
+
data.tar.gz: fb4a591712a21717ea434d007562044c4abb90433646cf9d89d95d92c2be173d179d3233c24adf51e298145946bcab8ad88af2060718a77ebd668651bed4d218
|
data/Gemfile.lock
CHANGED
data/exe/flowcation
CHANGED
@@ -1,45 +1,46 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'flowcation'
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
3
|
+
|
4
|
+
config_file_name = "flowcation"
|
5
|
+
|
6
|
+
if arg = ARGV[0]
|
7
|
+
config_file_name = arg
|
8
|
+
end
|
9
|
+
|
10
|
+
config_file_name += ".yml"
|
11
|
+
|
12
|
+
look_up_config_paths = %w(
|
13
|
+
.
|
14
|
+
flowcation
|
15
|
+
config
|
16
|
+
config/flowcation
|
17
|
+
).map {|p| File.join(Dir.pwd, p) }
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
config_path = ""
|
22
|
+
look_up_config_paths.each do |path|
|
23
|
+
next unless File.directory?(path)
|
24
|
+
entries = Dir.entries(path)
|
25
|
+
file = File.join(path, config_file_name)
|
26
|
+
config_path = file if entries.include?(config_file_name)
|
27
|
+
end
|
28
|
+
|
29
|
+
unless File.exists?(config_path)
|
30
|
+
puts "Config File Not Found"
|
31
|
+
puts "Lookup:"
|
32
|
+
puts look_up_config_paths
|
33
|
+
return 1
|
13
34
|
end
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
cmd = :generate
|
21
|
-
when "bootstrap"
|
22
|
-
cmd = :bootstrap
|
23
|
-
else
|
24
|
-
cmd = :generate
|
25
|
-
end
|
26
|
-
|
27
|
-
puts "#{cmd} #{options[:config]}"
|
28
|
-
|
29
|
-
if cmd == :generate
|
30
|
-
config = begin
|
31
|
-
YAML.load File.new(options[:config]).read
|
32
|
-
rescue Exception => e
|
33
|
-
puts "Invalid Configuration."
|
34
|
-
return 1
|
35
|
-
end
|
36
|
-
if config
|
37
|
-
if overwrite = options[:force_overwrite]
|
38
|
-
Flowcation::Settings.set('force-overwrite', true)
|
39
|
-
end
|
40
|
-
|
41
|
-
Flowcation::generate config
|
42
|
-
Flowcation::Runtime.instance.write_files
|
43
|
-
end
|
35
|
+
|
36
|
+
config = begin
|
37
|
+
YAML.load File.new(config_path).read
|
38
|
+
rescue Exception => e
|
39
|
+
puts "Invalid Configuration File: #{e}"
|
40
|
+
return 1
|
44
41
|
end
|
45
42
|
|
43
|
+
if config
|
44
|
+
Flowcation::generate config
|
45
|
+
Flowcation::Runtime.instance.write_files
|
46
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'flowcation'
|
3
|
+
require 'optparse'
|
4
|
+
|
5
|
+
options = {}
|
6
|
+
option_parser = OptionParser.new do |opts|
|
7
|
+
opts.on("-c config","--config config", "Relative Path to Yaml Configuration File") do |config|
|
8
|
+
options[:config] = File.join(Dir.pwd, config)
|
9
|
+
end
|
10
|
+
opts.on("-f","--force-overwrite", "Overwrite any file flowcation attempts to generate.") do
|
11
|
+
options[:force_overwrite] = true
|
12
|
+
end
|
13
|
+
end
|
14
|
+
option_parser.parse!
|
15
|
+
|
16
|
+
cmd = :generate
|
17
|
+
|
18
|
+
case ARGV[0]
|
19
|
+
when "generate"
|
20
|
+
cmd = :generate
|
21
|
+
when "bootstrap"
|
22
|
+
cmd = :bootstrap
|
23
|
+
else
|
24
|
+
cmd = :generate
|
25
|
+
end
|
26
|
+
|
27
|
+
puts "#{cmd} #{options[:config]}"
|
28
|
+
|
29
|
+
if cmd == :generate
|
30
|
+
config = begin
|
31
|
+
YAML.load File.new(options[:config]).read
|
32
|
+
rescue Exception => e
|
33
|
+
puts "Invalid Configuration."
|
34
|
+
return 1
|
35
|
+
end
|
36
|
+
if config
|
37
|
+
if overwrite = options[:force_overwrite]
|
38
|
+
Flowcation::Settings.set('force-overwrite', true)
|
39
|
+
end
|
40
|
+
|
41
|
+
Flowcation::generate config
|
42
|
+
Flowcation::Runtime.instance.write_files
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
data/lib/flowcation.rb
CHANGED
@@ -28,6 +28,7 @@ module Flowcation
|
|
28
28
|
def self.generate(config)
|
29
29
|
Flowcation::Settings.from_config(config['flowcation'])
|
30
30
|
Flowcation::Assets.from_config(config['assets'])
|
31
|
+
Flowcation::Assets.from_config(config['files'])
|
31
32
|
|
32
33
|
Flowcation::Runtime.register_layouts_from_config(config['layouts'])
|
33
34
|
Flowcation::Runtime.register_templates_from_config(config['templates'])
|
data/lib/flowcation/assets.rb
CHANGED
@@ -2,7 +2,7 @@ module Flowcation
|
|
2
2
|
class Assets
|
3
3
|
|
4
4
|
def self.from_config(config={})
|
5
|
-
config
|
5
|
+
config&.each do |name, options|
|
6
6
|
options['folders'].each do |path, asset_folder_name|
|
7
7
|
asset_folder_path = File.join(options['output'], asset_folder_name)
|
8
8
|
FileUtils.mkdir_p(asset_folder_path)
|
@@ -11,6 +11,12 @@ module Flowcation
|
|
11
11
|
source: File.join(options['input'], path),
|
12
12
|
target: asset_folder
|
13
13
|
end
|
14
|
+
options['files'].each do |file_name|
|
15
|
+
output_folder_path = File.join(options['output'])
|
16
|
+
FileUtils.mkdir_p(output_folder_path)
|
17
|
+
output_folder = File.new(output_folder_path)
|
18
|
+
FileUtils.cp(File.join(options['input'], file_name), output_folder)
|
19
|
+
end
|
14
20
|
end
|
15
21
|
end
|
16
22
|
|
data/lib/flowcation/settings.rb
CHANGED
data/lib/flowcation/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flowcation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Hennemeyer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- bin/console
|
100
100
|
- bin/setup
|
101
101
|
- exe/flowcation
|
102
|
+
- exe/flowcation_with_options
|
102
103
|
- flowcation.gemspec
|
103
104
|
- lib/flowcation.rb
|
104
105
|
- lib/flowcation/assets.rb
|