squareone 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.codeclimate.yml +14 -0
- data/.travis.yml +4 -0
- data/Gemfile +2 -0
- data/README.md +12 -1
- data/bin/console +1 -8
- data/bin/squareone +1 -1
- data/lib/squareone/cli.rb +4 -15
- data/lib/squareone/generator.rb +32 -8
- data/lib/squareone/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: 3914fe6b44cb6b509bc2f90c8da72ae54e2c9ee2
|
4
|
+
data.tar.gz: 47a27dd6e4e1f534a94ddcad88c52da837134353
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0b81b0dfa2ad7f09c2365e9f807d55c986c4520980e1b595e3a53a0dbf4cc84aa82bdb448ebc2c8118b11984f069fb058fa564ff52d1d1e7255aa36c7db5200
|
7
|
+
data.tar.gz: 2ac5431b12674e9b2cf70a1870182a180bbdf3748ed7853372618bd0d185e2f0d227392082092877ae004481d499a3867066874311e596906bea23ebc61447a3
|
data/.codeclimate.yml
ADDED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Squareone
|
2
2
|
|
3
|
-
[![Gem Version]
|
3
|
+
[![Gem Version][gem-image]][gem-url] [![Build Status][travis-image]][travis-url] [![Code Climate][codeclimate-image]][codeclimate-url] [![Test Coverage][coverage-image]][coverage-url]
|
4
4
|
|
5
5
|
__Squareone__ is Jekyll site project generator with Gulp task automation work-flow.
|
6
6
|
|
@@ -43,3 +43,14 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/codaye
|
|
43
43
|
|
44
44
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
45
45
|
|
46
|
+
[gem-url]: https://badge.fury.io/rb/squareone
|
47
|
+
[gem-image]: https://badge.fury.io/rb/squareone.svg
|
48
|
+
|
49
|
+
[travis-url]: https://travis-ci.org/codaye/squareone
|
50
|
+
[travis-image]: https://travis-ci.org/codaye/squareone.svg?branch=master
|
51
|
+
|
52
|
+
[codeclimate-url]: https://codeclimate.com/github/codaye/squareone
|
53
|
+
[codeclimate-image]: https://codeclimate.com/github/codaye/squareone/badges/gpa.svg
|
54
|
+
|
55
|
+
[coverage-image]: https://codeclimate.com/github/codaye/squareone/badges/coverage.svg
|
56
|
+
[coverage-url]: https://codeclimate.com/github/codaye/squareone/coverage
|
data/bin/console
CHANGED
@@ -2,13 +2,6 @@
|
|
2
2
|
|
3
3
|
require "bundler/setup"
|
4
4
|
require "squareone"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
5
|
require "pry"
|
11
|
-
Pry.start
|
12
6
|
|
13
|
-
|
14
|
-
# IRB.start
|
7
|
+
Pry.start
|
data/bin/squareone
CHANGED
data/lib/squareone/cli.rb
CHANGED
@@ -1,28 +1,17 @@
|
|
1
1
|
require "thor/group"
|
2
2
|
|
3
|
-
class Squareone::
|
3
|
+
class Squareone::CLI < Thor
|
4
|
+
|
5
|
+
# USAGE: squareone -v
|
4
6
|
desc "-v", "Dispaly Squareone version"
|
5
7
|
map %w[-v --version] => :version
|
6
|
-
|
7
|
-
# Display gem
|
8
|
-
# USAGE: squareone -v
|
9
8
|
def version
|
10
9
|
say "squareone #{Squareone::VERSION}"
|
11
10
|
end
|
12
11
|
|
13
12
|
# Create a new project
|
14
13
|
# USAGE: squareone new new-project
|
15
|
-
|
16
|
-
def new(path)
|
17
|
-
project_root = File.expand_path(path)
|
18
|
-
raise Error, set_color("ERROR: #{path} already exists.", :red) if File.exist?(path)
|
19
|
-
|
20
|
-
say set_color("Creating project #{path}...", :green)
|
21
|
-
|
22
|
-
generator = Squareone::Generator.new
|
23
|
-
generator.destination_root = project_root
|
24
|
-
generator.invoke_all
|
25
|
-
end
|
14
|
+
register Squareone::Generator, "new", "new APP_PATH", "Creates a new project"
|
26
15
|
|
27
16
|
def self.exit_on_failure?
|
28
17
|
true
|
data/lib/squareone/generator.rb
CHANGED
@@ -3,18 +3,23 @@ require "thor/group"
|
|
3
3
|
|
4
4
|
class Squareone::Generator < Thor::Group
|
5
5
|
include Thor::Actions
|
6
|
-
desc "Create a Gulp automated Jekyll project"
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "lib", "templates"))
|
11
|
-
end
|
7
|
+
desc "Create a Gulp automated Jekyll project"
|
8
|
+
argument :name, type: :string, desc: "Name of the project"
|
12
9
|
|
13
|
-
#
|
14
|
-
def
|
15
|
-
name = destination_root.split(/\//).last
|
10
|
+
# Setup generator
|
11
|
+
def setup
|
16
12
|
@project_name = name.downcase
|
13
|
+
|
14
|
+
raise Thor::Error, set_color("ERROR: #{@project_name} already exist.", :red) if File.exist?(@project_name)
|
15
|
+
|
17
16
|
@project_title = name.split(/[- _]/).map(&:capitalize).join(' ')
|
17
|
+
self.destination_root = File.expand_path(@project_name)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Declare source files directory
|
21
|
+
def self.source_root
|
22
|
+
File.expand_path("../templates", File.dirname(__FILE__))
|
18
23
|
end
|
19
24
|
|
20
25
|
# Copy files in folders
|
@@ -45,4 +50,23 @@ class Squareone::Generator < Thor::Group
|
|
45
50
|
copy_file file
|
46
51
|
end
|
47
52
|
end
|
53
|
+
|
54
|
+
def success_message
|
55
|
+
message = <<-MSG
|
56
|
+
=============================================
|
57
|
+
Project #{@project_name} created successfully.
|
58
|
+
|
59
|
+
1. Move into the project directory.
|
60
|
+
$ cd #{@project_name}
|
61
|
+
|
62
|
+
2. Install project dependencies.
|
63
|
+
$ npm install
|
64
|
+
|
65
|
+
3. Start local server with gulp watching for changes.
|
66
|
+
$ npm start
|
67
|
+
===========================================
|
68
|
+
MSG
|
69
|
+
|
70
|
+
say message
|
71
|
+
end
|
48
72
|
end
|
data/lib/squareone/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squareone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Azemoh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -88,6 +88,7 @@ executables:
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
+
- ".codeclimate.yml"
|
91
92
|
- ".gitignore"
|
92
93
|
- ".rspec"
|
93
94
|
- ".travis.yml"
|