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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8438d486194b75c4d7c37e0d51e5e4d949aa2d4
4
- data.tar.gz: 7f891d43de77ce1fa2eed359c473fcc10c4aa09d
3
+ metadata.gz: 9ccb62d508ea34d12c5ba0097e3271660c33328f
4
+ data.tar.gz: 904f87548e0650145e4d0bfc3e9730d1ed7c4d1d
5
5
  SHA512:
6
- metadata.gz: 135f43dbdb37de7ce5b0af32d10ddfd41fbec100101c3a91847fdc5850b66093e4da017d289a739cf8f9e755b760280e86bec50330509724f4869e20f1637e52
7
- data.tar.gz: 994e263ce40ddcf2cd2db3b9c508316287ff5c5931320dad4dc8c7d03bc694c79e39b0ca5c368269d3e1b9265a00f41fb31fab46c9b0e8c0833cf44776329b07
6
+ metadata.gz: 4efe2bbdf68b2ca464cc04c28d6e1383fad9cfa8713669c8707816c08292bf1b843e8cdcc05aab7351449c16bb5e454c1bcf697a9616508b63205c007a3690d8
7
+ data.tar.gz: f2601a22b7170d99ef74af24c0d86a94c431334bd1e540f80ac06f61e79ca203ca4d1f1b28eb9a505a5d091517704aa9bbce20305e20719c77c73a59874760dd
@@ -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 'commander', '~> 4.4'
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'
@@ -2,26 +2,22 @@ require 'flutterby'
2
2
  require 'flutterby/exporter'
3
3
  require "flutterby/server"
4
4
 
5
- require 'commander'
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
- Commander.configure do
11
- program :name, 'Flutterby'
12
- program :version, Flutterby::VERSION
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
- command :build do |c|
16
- c.syntax = 'flutterby build [options]'
17
- c.description = "Build your website."
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
- c.action do |args, options|
55
- options.default in: "./site/", port: 4004
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)
@@ -1,3 +1,3 @@
1
1
  module Flutterby
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
  end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
3
+
4
+ gem "flutterby"
5
+ # gem "flutterby-coffeescript"
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>My Site</title>
6
+ <link rel="stylesheet" href="/css/styles.css">
7
+ </head>
8
+ <body>
9
+ <%= yield %>
10
+ </body>
11
+ </html>
@@ -0,0 +1 @@
1
+ /* add your SCSS here */
@@ -0,0 +1,3 @@
1
+ # Hi!
2
+
3
+ This is my new website!
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.18
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: commander
98
+ name: thor
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '4.4'
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: '4.4'
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