nsc 0.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ec4e00e580d849deb0382992a6d967c4376e326e
4
+ data.tar.gz: 81c31b83d3f50b95d62dec05c492b54ffd67b4a8
5
+ SHA512:
6
+ metadata.gz: c1ae5462847992d0b92378996c0e3897f7ad64aea2a4487c1232e272582320127290492a351dcb39c41ee1494cc47fa2c055ec6d3bb1cbe542acafb2c4061873
7
+ data.tar.gz: 5dbc8355212211cda27a093171fb63e655835eeca2a6d32d3db35f00480fb3e774e2a31a2519b442bc6b88c38066928db5c60fa7d5ea56d857f7e6b4e22155da
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ .DS_Store
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.3
4
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in nsc.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 jona hugger
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,20 @@
1
+ # Nsc
2
+
3
+ _nsc: (420) No Scope Commits_
4
+
5
+ This is a small gem intended to help you commit in the Angular Commit style, but
6
+ without the commit scope (since we think it's mostly useless). It's modeled after
7
+ the great NPM package commitizen, but does not require any sort of configuration
8
+ (since it's already really opinionated).
9
+
10
+ ```bash
11
+ gem install nsc
12
+ ```
13
+
14
+ ```bash
15
+ nsc commit
16
+ ```
17
+
18
+ ## License
19
+
20
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/bin/nsc ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'nsc'
4
+
5
+ Nsc.start(ARGV)
@@ -0,0 +1,31 @@
1
+ # rubocop:disable Metrics/LineLength
2
+
3
+ require 'nsc/version'
4
+ require 'nsc/util'
5
+ require 'inquirer'
6
+ require 'cocaine'
7
+
8
+ class Nsc
9
+ desc 'commit', 'commit with nsc'
10
+ option :add, aliases: :a, type: :boolean
11
+ def commit
12
+ type = Nsc::Util::SHORTTYPES[Ask.list('Choose a type', Nsc::Util::TYPES)]
13
+ msg = Ask.input 'Enter a commit message'
14
+ body = Ask.input 'Enter an optional commit body'
15
+
16
+ Cocaine::CommandLine.new('git', 'add --all').run if options[:add]
17
+ construct_commit type, msg, body
18
+ end
19
+
20
+ map 'c' => 'commit', 'a' => 'commit -a'
21
+ default_task :commit
22
+
23
+ private
24
+
25
+ def construct_commit(type, msg, body)
26
+ # somehow it breaks if you do it with template strings
27
+ final_msg = "#{type}: #{msg}"
28
+ cmd = Cocaine::CommandLine.new('git', body.strip.empty? ? "commit -m '#{final_msg}'" : "commit -m '#{final_msg}' -m '#{body}'")
29
+ cmd.run
30
+ end
31
+ end
@@ -0,0 +1,30 @@
1
+ # rubocop:disable Metrics/LineLength
2
+
3
+ require 'pastel'
4
+
5
+ class Nsc
6
+ module Util
7
+ pastel = Pastel.new
8
+ TYPES = [
9
+ pastel.bold('feat') + ': a new feature',
10
+ pastel.bold('fix') + ': a bug fix',
11
+ pastel.bold('docs') + ': documentation only changes',
12
+ pastel.bold('style') + ': changes that do not affect the meaning of the code',
13
+ pastel.bold('refactor') + ': a code change that neither fixes a bug nor adds a new feature',
14
+ pastel.bold('perf') + ': a code change that improves performance',
15
+ pastel.bold('test') + ': adds missing tests',
16
+ pastel.bold('chore') + ': changes to the build process or auxiliary tools or libraries such as documentation generation'
17
+ ]
18
+
19
+ SHORTTYPES = %w(
20
+ 'feat'
21
+ 'fix'
22
+ 'docs'
23
+ 'style'
24
+ 'refactor'
25
+ 'perf'
26
+ 'test'
27
+ 'chore'
28
+ )
29
+ end
30
+ end
@@ -0,0 +1,5 @@
1
+ require 'thor'
2
+
3
+ class Nsc < Thor
4
+ VERSION = '0.1.0'
5
+ end
@@ -0,0 +1,26 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'nsc/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'nsc'
7
+ spec.version = Nsc::VERSION
8
+ spec.authors = ['jh']
9
+ spec.email = ['jona@jona.io']
10
+ spec.summary = 'angular commits minus stuff'
11
+ spec.homepage = 'https://github.com/Retrospring/nsc'
12
+ spec.license = 'MIT'
13
+
14
+ spec.files = `git ls-files -z`.split("\x0")
15
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ spec.require_paths = ['lib']
18
+
19
+ spec.add_dependency 'thor', '~> 0.19.1'
20
+ spec.add_dependency 'inquirer', '~> 0.2.1'
21
+ spec.add_dependency 'pastel', '~> 0.5.1'
22
+ spec.add_dependency 'cocaine', '~> 0.5.7'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.6'
25
+ spec.add_development_dependency 'rake'
26
+ end
metadata ADDED
@@ -0,0 +1,140 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nsc
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - jh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.19.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.19.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: inquirer
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.2.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.2.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: pastel
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.5.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.5.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: cocaine
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.5.7
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.5.7
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.6'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.6'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description:
98
+ email:
99
+ - jona@jona.io
100
+ executables:
101
+ - nsc
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - ".gitignore"
106
+ - ".travis.yml"
107
+ - Gemfile
108
+ - LICENSE
109
+ - README.md
110
+ - Rakefile
111
+ - bin/nsc
112
+ - lib/nsc.rb
113
+ - lib/nsc/util.rb
114
+ - lib/nsc/version.rb
115
+ - nsc.gemspec
116
+ homepage: https://github.com/Retrospring/nsc
117
+ licenses:
118
+ - MIT
119
+ metadata: {}
120
+ post_install_message:
121
+ rdoc_options: []
122
+ require_paths:
123
+ - lib
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ requirements: []
135
+ rubyforge_project:
136
+ rubygems_version: 2.4.5.1
137
+ signing_key:
138
+ specification_version: 4
139
+ summary: angular commits minus stuff
140
+ test_files: []