flutterby 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/flutterby.gemspec +2 -1
- data/lib/flutterby/cli.rb +41 -26
- data/lib/flutterby/version.rb +1 -1
- data/lib/templates/new_project/Gemfile +5 -0
- data/lib/templates/new_project/site/_layout.erb +11 -0
- data/lib/templates/new_project/site/css/styles.css.scss +1 -0
- data/lib/templates/new_project/site/index.html.md +3 -0
- metadata +22 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ccb62d508ea34d12c5ba0097e3271660c33328f
|
4
|
+
data.tar.gz: 904f87548e0650145e4d0bfc3e9730d1ed7c4d1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4efe2bbdf68b2ca464cc04c28d6e1383fad9cfa8713669c8707816c08292bf1b843e8cdcc05aab7351449c16bb5e454c1bcf697a9616508b63205c007a3690d8
|
7
|
+
data.tar.gz: f2601a22b7170d99ef74af24c0d86a94c431334bd1e540f80ac06f61e79ca203ca4d1f1b28eb9a505a5d091517704aa9bbce20305e20719c77c73a59874760dd
|
data/flutterby.gemspec
CHANGED
@@ -28,7 +28,8 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency 'gem-release', '~> 0'
|
29
29
|
spec.add_development_dependency 'pry', '~> 0.10'
|
30
30
|
|
31
|
-
spec.add_dependency '
|
31
|
+
spec.add_dependency 'thor', '~> 0.19'
|
32
|
+
spec.add_dependency 'highline', '~> 1.7'
|
32
33
|
spec.add_dependency 'slodown', '~> 0.3'
|
33
34
|
spec.add_dependency 'builder', '~> 3.2'
|
34
35
|
spec.add_dependency 'sass', '~> 3.4'
|
data/lib/flutterby/cli.rb
CHANGED
@@ -2,26 +2,22 @@ require 'flutterby'
|
|
2
2
|
require 'flutterby/exporter'
|
3
3
|
require "flutterby/server"
|
4
4
|
|
5
|
-
require '
|
5
|
+
require 'thor'
|
6
|
+
require 'thor/group'
|
7
|
+
require 'highline/import'
|
6
8
|
require 'benchmark'
|
7
9
|
|
8
10
|
Flutterby.logger.level = Logger::INFO
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
program :description, 'There are many static site generators. This one is mine.'
|
12
|
+
module Flutterby
|
13
|
+
class CLI < Thor
|
14
|
+
include Thor::Actions
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
c.option '--in DIR', String, "Directory containing your source files"
|
20
|
-
c.option '--out DIR', String, "Target directory"
|
21
|
-
|
22
|
-
c.action do |args, options|
|
23
|
-
options.default in: "./site/", out: "./_build/"
|
16
|
+
desc "build", "Build your static site"
|
17
|
+
option :in, default: "./site/", aliases: [:i]
|
18
|
+
option :out, default: "./_build/", aliases: [:o]
|
24
19
|
|
20
|
+
def build
|
25
21
|
# Simplify logger output
|
26
22
|
Flutterby.logger.formatter = proc do |severity, datetime, progname, msg|
|
27
23
|
" • #{msg}\n"
|
@@ -41,19 +37,13 @@ Commander.configure do
|
|
41
37
|
|
42
38
|
say color("✅ Done. (took #{sprintf "%.2f", time}s)", :green, :bold)
|
43
39
|
end
|
44
|
-
end
|
45
|
-
alias_command :b, :build
|
46
|
-
|
47
|
-
command :serve do |c|
|
48
|
-
c.syntax = 'flutterby serve [options]'
|
49
|
-
c.description = "Serve your website for development."
|
50
40
|
|
51
|
-
c.option '--in DIR', String, "Directory containing your source files"
|
52
|
-
c.option '--port NUM', String, "Port to serve on (default: 4004)"
|
53
41
|
|
54
|
-
|
55
|
-
|
42
|
+
desc "serve", "Serve your site locally"
|
43
|
+
option :in, default: "./site/", aliases: [:i]
|
44
|
+
option :port, default: 4004, aliases: [:p], type: :numeric
|
56
45
|
|
46
|
+
def serve
|
57
47
|
say color("📚 Importing site...", :bold)
|
58
48
|
root = Flutterby::Node.new("/", fs_path: options.in)
|
59
49
|
root.stage!
|
@@ -63,7 +53,32 @@ Commander.configure do
|
|
63
53
|
server = Flutterby::Server.new(root, port: options.port)
|
64
54
|
server.run!
|
65
55
|
end
|
56
|
+
|
57
|
+
|
58
|
+
desc "new PATH", "Create a new Flutterby project"
|
59
|
+
def new(path)
|
60
|
+
path = File.expand_path(path)
|
61
|
+
self.destination_root = path
|
62
|
+
|
63
|
+
say color("🦋 Creating a new Flutterby project in #{path}...", :bold)
|
64
|
+
directory("new_project", path)
|
65
|
+
in_root do
|
66
|
+
Bundler.with_clean_env do
|
67
|
+
run "bundle install"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
private
|
73
|
+
|
74
|
+
def color(*args)
|
75
|
+
$terminal.color(*args)
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.source_root
|
79
|
+
File.expand_path("../templates/", File.dirname(__FILE__))
|
80
|
+
end
|
66
81
|
end
|
67
|
-
alias_command :server, :serve
|
68
|
-
alias_command :s, :serve
|
69
82
|
end
|
83
|
+
|
84
|
+
Flutterby::CLI.start(ARGV)
|
data/lib/flutterby/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
/* add your SCSS here */
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flutterby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hendrik Mans
|
@@ -95,19 +95,33 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.10'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: thor
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '0.19'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '0.19'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: highline
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.7'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.7'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: slodown
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -263,6 +277,10 @@ files:
|
|
263
277
|
- lib/flutterby/server.rb
|
264
278
|
- lib/flutterby/version.rb
|
265
279
|
- lib/flutterby/view.rb
|
280
|
+
- lib/templates/new_project/Gemfile
|
281
|
+
- lib/templates/new_project/site/_layout.erb
|
282
|
+
- lib/templates/new_project/site/css/styles.css.scss
|
283
|
+
- lib/templates/new_project/site/index.html.md
|
266
284
|
homepage: https://github.com/hmans/flutterby
|
267
285
|
licenses:
|
268
286
|
- MIT
|