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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1b61b1522c09c763494beb5b1ac90b3172f1753
4
- data.tar.gz: 774e77299e76a930042d3da938063dd85148d694
3
+ metadata.gz: 3914fe6b44cb6b509bc2f90c8da72ae54e2c9ee2
4
+ data.tar.gz: 47a27dd6e4e1f534a94ddcad88c52da837134353
5
5
  SHA512:
6
- metadata.gz: 53bf1383358e02fef038d9637e2fae88d68628cc7bded431b3a80d37a4e59d02bfb876896a6e5b525bf41819ebf0b8f38ad82a139ca2be17ca98d699d08153da
7
- data.tar.gz: b17d2beb739889d3cd72a7347356a77ca819cdbc2dfa15a7088afd79f9384bca335d2fa5b4b359ade610d665306475c82a45de1f7e773385ac23707097ca4f36
6
+ metadata.gz: f0b81b0dfa2ad7f09c2365e9f807d55c986c4520980e1b595e3a53a0dbf4cc84aa82bdb448ebc2c8118b11984f069fb058fa564ff52d1d1e7255aa36c7db5200
7
+ data.tar.gz: 2ac5431b12674e9b2cf70a1870182a180bbdf3748ed7853372618bd0d185e2f0d227392082092877ae004481d499a3867066874311e596906bea23ebc61447a3
data/.codeclimate.yml ADDED
@@ -0,0 +1,14 @@
1
+ engines:
2
+ rubocop:
3
+ enabled: true
4
+ duplication:
5
+ enabled: true
6
+ config:
7
+ languages:
8
+ - ruby
9
+ ratings:
10
+ paths:
11
+ - lib/
12
+ exclude_paths:
13
+ - lib/templates
14
+ - spec/
data/.travis.yml CHANGED
@@ -2,3 +2,7 @@ language: ruby
2
2
  rvm:
3
3
  - 2.1.5
4
4
  before_install: gem install bundler -v 1.11.2
5
+
6
+ addons:
7
+ code_climate:
8
+ repo_token: 32e30f5d46812a4a2931181b61bfceef383b2b93c00a388ebb798399d2e8cb08
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in squareone.gemspec
4
4
  gemspec
5
+
6
+ gem "codeclimate-test-reporter", group: :test, require: nil
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Squareone
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/squareone.svg)](https://badge.fury.io/rb/squareone)
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
- # require "irb"
14
- # IRB.start
7
+ Pry.start
data/bin/squareone CHANGED
@@ -3,4 +3,4 @@ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib
3
3
 
4
4
  require 'squareone'
5
5
 
6
- Squareone::Cli.start
6
+ Squareone::CLI.start
data/lib/squareone/cli.rb CHANGED
@@ -1,28 +1,17 @@
1
1
  require "thor/group"
2
2
 
3
- class Squareone::Cli < Thor
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
- desc "new NAME", "Create a new project"
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
@@ -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
- # Declare source files directory
9
- def self.source_root
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
- # Set template variables
14
- def set_variables
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
@@ -1,3 +1,3 @@
1
1
  module Squareone
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
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.1
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-07-26 00:00:00.000000000 Z
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"