semmy 0.2.1 → 0.3.0

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: 15b57afe682998646f2c1c5c42d72895b1b80a13
4
- data.tar.gz: 9811d697c18e5f3f6754da5d91ed25b56f1a9577
3
+ metadata.gz: 5bc7f29004979528fcaddf47d8f0538d6b3e7176
4
+ data.tar.gz: c176ee31e95d87d6e6c097db4861fcc5d9ce9dfb
5
5
  SHA512:
6
- metadata.gz: 8be9bd569465595894313a4b37862b062fef870cc0ad90be29db7dd99337258e0bab23017cbae107dafb35fd2c5a877e279fd33b19105fa44559ea281f6c9744
7
- data.tar.gz: 4734cbc6470c17fd6f4f257c6a4643387005f6a593ca4145e183b9b4a3eee4a7c51456604ae788aa115604fee67ae333b76c144bb4e840a013e25937a5cb993f
6
+ metadata.gz: ae0601113bb307b34a638267abc40487a37d1abd53704c3c7cd3649689d758fb0d17d658f1a51109bd571ccb271fb5d2e71e1b62b4ecb64f056264eb0893b3b5
7
+ data.tar.gz: 64fc0cae3c667e031da0198b82982b542152e5f33873453e345a9e1fd8dbdbd832a33f3ba031e0d30e1df8438ba7b4619b757313ba49403ad7d56cc7e18c7af8
data/.rubocop.yml ADDED
@@ -0,0 +1,27 @@
1
+ # Use double quotes only for interpolation.
2
+ Style/StringLiterals:
3
+ EnforcedStyle: single_quotes
4
+
5
+ # Place dots at the beginning of multiline method calls.
6
+ Style/DotPosition:
7
+ EnforcedStyle: leading
8
+
9
+ # Allow using {} when chaining methods
10
+ Style/BlockDelimiters:
11
+ EnforcedStyle: braces_for_chaining
12
+
13
+ # The default of 80 characters is a little to narrow.
14
+ Metrics/LineLength:
15
+ Max: 100
16
+
17
+ # Only place spaces inside blocks written with braces.
18
+ Style/SpaceInsideHashLiteralBraces:
19
+ EnforcedStyle: no_space
20
+
21
+ # Allow extend self
22
+ Style/ModuleFunction:
23
+ Enabled: false
24
+
25
+ # Do not require class and module doc strings
26
+ Style/Documentation:
27
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
- ### Version 0.2.1
3
+ ### Version 0.3.0
4
4
 
5
- 2016-06-09
5
+ 2016-09-09
6
6
 
7
- [Compare changes](https://github.com/tf/semmy/compare/v0.2.0...v0.2.1)
7
+ [Compare changes](https://github.com/tf/semmy/compare/v0.2.0...v0.3.0)
8
8
 
9
9
  - Fix default GitHub compare url.
10
10
  - Add link comparing to last patch level for stable release.
data/bin/rubocop ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rubocop' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("rubocop", "rubocop")
data/lib/semmy.rb CHANGED
@@ -6,6 +6,7 @@ require 'semmy/doc_tags'
6
6
  require 'semmy/files'
7
7
  require 'semmy/gemspec'
8
8
  require 'semmy/project'
9
+ require 'semmy/ruby_gems'
9
10
  require 'semmy/scm'
10
11
  require 'semmy/shell'
11
12
  require 'semmy/tasks'
data/lib/semmy/gemspec.rb CHANGED
@@ -12,15 +12,15 @@ module Semmy
12
12
  specification.homepage
13
13
  end
14
14
 
15
+ def path
16
+ Dir.glob('*.gemspec').first ||
17
+ fail(NotFound, 'Gemspec not found.')
18
+ end
19
+
15
20
  private
16
21
 
17
22
  def specification
18
23
  Gem::Specification.load(path)
19
24
  end
20
-
21
- def path
22
- Dir.glob('*.gemspec').first ||
23
- fail(NotFound, 'Gemspec not found.')
24
- end
25
25
  end
26
26
  end
data/lib/semmy/project.rb CHANGED
@@ -6,6 +6,10 @@ module Semmy
6
6
  VersionFile.parse_version(File.read(version_file))
7
7
  end
8
8
 
9
+ def has_not_yet_imported_locales?
10
+ Dir.glob('config/locales/new/**/*.yml').any?
11
+ end
12
+
9
13
  private
10
14
 
11
15
  def version_file
@@ -0,0 +1,23 @@
1
+ module Semmy
2
+ module RubyGems
3
+ extend self
4
+
5
+ def build_and_test_install
6
+ Shell.sub_process_output(`#{command}`)
7
+ $?.success?
8
+ end
9
+
10
+ private
11
+
12
+ def command
13
+ "gem build -V #{Gemspec.path} 2>&1 && " \
14
+ "gem install --local #{built_gem_path} 2>&1 && " \
15
+ "gem uninstall #{Gemspec.gem_name} -v #{Project.version} 2>&1 && " \
16
+ "rm #{built_gem_path}" \
17
+ end
18
+
19
+ def built_gem_path
20
+ [Gemspec.gem_name, '-', Project.version, '.gem'].join
21
+ end
22
+ end
23
+ end
data/lib/semmy/shell.rb CHANGED
@@ -10,6 +10,14 @@ module Semmy
10
10
  say(text, :green)
11
11
  end
12
12
 
13
+ def error(text)
14
+ say(text, :red)
15
+ end
16
+
17
+ def sub_process_output(text)
18
+ say(text, :yellow)
19
+ end
20
+
13
21
  private
14
22
 
15
23
  def say(text, color)
data/lib/semmy/tasks.rb CHANGED
@@ -5,6 +5,7 @@ require 'semmy/tasks/branches'
5
5
  require 'semmy/tasks/changelog_sections'
6
6
  require 'semmy/tasks/commit'
7
7
  require 'semmy/tasks/docs'
8
+ require 'semmy/tasks/lint'
8
9
  require 'semmy/tasks/versioning'
9
10
 
10
11
  module Semmy
@@ -17,6 +18,7 @@ module Semmy
17
18
  yield config if block_given?
18
19
 
19
20
  namespace 'semmy' do
21
+ Lint.new(config)
20
22
  Versioning.new(config)
21
23
  Docs.new(config)
22
24
  ChangelogSections.new(config)
@@ -39,7 +41,7 @@ module Semmy
39
41
  ]
40
42
 
41
43
  desc 'Prepare release'
42
- task 'release:prepare' do
44
+ task 'release:prepare' => 'semmy:lint' do
43
45
  if Scm.on_master?
44
46
  Rake.application['release:prepare:master'].invoke
45
47
  elsif Scm.on_stable?(config.stable_branch_name)
@@ -0,0 +1,31 @@
1
+ require 'git'
2
+
3
+ module Semmy
4
+ module Tasks
5
+ class Lint < Base
6
+ def define
7
+ task 'lint' => ['lint:install', 'lint:locales']
8
+
9
+ namespace 'lint' do
10
+ task 'install' do
11
+ Shell.info('Ensuring gem can be installed.')
12
+
13
+ unless RubyGems.build_and_test_install
14
+ Shell.error('Test install failed.')
15
+ exit(1)
16
+ end
17
+ end
18
+
19
+ task 'locales' do
20
+ Shell.info('Checking for not yet imported locales.')
21
+
22
+ if Project.has_not_yet_imported_locales?
23
+ Shell.error('There are still files in config/locales/new.')
24
+ exit(1)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
data/lib/semmy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Semmy
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
data/semmy.gemspec CHANGED
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'bundler', '~> 1.10'
26
26
  spec.add_development_dependency 'rake', '~> 11.0'
27
27
  spec.add_development_dependency 'rspec', '~> 3.0'
28
+ spec.add_development_dependency 'rubocop', '~> 0.42.0'
28
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semmy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Fischbach
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-09 00:00:00.000000000 Z
11
+ date: 2016-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.42.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.42.0
97
111
  description:
98
112
  email:
99
113
  - mail@timfischbach.de
@@ -103,6 +117,7 @@ extra_rdoc_files: []
103
117
  files:
104
118
  - ".gitignore"
105
119
  - ".rspec"
120
+ - ".rubocop.yml"
106
121
  - ".travis.yml"
107
122
  - CHANGELOG.md
108
123
  - CODE_OF_CONDUCT.md
@@ -113,6 +128,7 @@ files:
113
128
  - bin/console
114
129
  - bin/rake
115
130
  - bin/rspec
131
+ - bin/rubocop
116
132
  - bin/setup
117
133
  - lib/semmy.rb
118
134
  - lib/semmy/changelog.rb
@@ -122,6 +138,7 @@ files:
122
138
  - lib/semmy/files.rb
123
139
  - lib/semmy/gemspec.rb
124
140
  - lib/semmy/project.rb
141
+ - lib/semmy/ruby_gems.rb
125
142
  - lib/semmy/scm.rb
126
143
  - lib/semmy/shell.rb
127
144
  - lib/semmy/tasks.rb
@@ -130,6 +147,7 @@ files:
130
147
  - lib/semmy/tasks/changelog_sections.rb
131
148
  - lib/semmy/tasks/commit.rb
132
149
  - lib/semmy/tasks/docs.rb
150
+ - lib/semmy/tasks/lint.rb
133
151
  - lib/semmy/tasks/versioning.rb
134
152
  - lib/semmy/version.rb
135
153
  - lib/semmy/version_file.rb
@@ -155,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
173
  version: '0'
156
174
  requirements: []
157
175
  rubyforge_project:
158
- rubygems_version: 2.2.5
176
+ rubygems_version: 2.5.1
159
177
  signing_key:
160
178
  specification_version: 4
161
179
  summary: Rake tasks for a semantic versioning of gems