mkgem 0.1.0 → 0.1.1

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: c5ade3b6dee7ad1d383b0ca09fcb7fa6e15fe5f9
4
- data.tar.gz: 4a7e00eb57c4cd7d2ba357c9da6b024fb01164fc
3
+ metadata.gz: afde3a758ccd0f8a64b0a715eca685ea7cf704a7
4
+ data.tar.gz: 68299a2dffede2ab35e79a3c763d8a089da951f1
5
5
  SHA512:
6
- metadata.gz: b108be53341f800c20d00c88a8fbe5d6b513b6c31324ed95cf04bfc2da014dce83e71c7c201daeb61ed1e683841b577d069ab30246657a7b2368eb760ea9da3b
7
- data.tar.gz: f850fea4ae3c428a658010c2753f25a15289fd22cb752b3b744eada3fd198ae3f6c94783bab6c5e11a4090c19207fcfefd43af215eadf8e7fb0096d12e54ad57
6
+ metadata.gz: 62024bfcdc80d2d381452b4491240202b95d4960a7403f9065ed3c7c6e292560d247cdda4d8fa92a4fd1c52234fd3c4b2eb579b6cdd87b48ca27fdc5ee73d18b
7
+ data.tar.gz: 1e97f139101ae4fc5538e47f69b7aa07ad08c7246f83d03d387aec376059261d69b30efa0a544f4e586d45ad96ae616527dbc562f4cabe472de98f47d37d0592
data/README.md CHANGED
@@ -1,3 +1,23 @@
1
1
  # mkgem
2
2
 
3
3
  An opinionated Ruby gem generator.
4
+
5
+ ## Why?
6
+
7
+ Because i'm tired of `bundle gem` clutter.
8
+
9
+ ## Installation
10
+
11
+ As usual:
12
+
13
+ ```shell
14
+ $ gem install mkgem
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Run following command:
20
+
21
+ ```shell
22
+ $ mkgem another_useless_gem
23
+ ```
@@ -1,5 +1,8 @@
1
1
  require 'thor'
2
2
  require 'active_support/core_ext/string/inflections'
3
+ require 'net/http'
4
+ require 'json'
3
5
 
4
6
  require 'mkgem/version'
5
7
  require 'mkgem/cli'
8
+ require 'mkgem/dependencies'
@@ -0,0 +1,9 @@
1
+ module Mkgem
2
+ module Dependencies
3
+ def self.[](name)
4
+ JSON.parse(
5
+ Net::HTTP.get(URI("https://rubygems.org/api/v1/gems/#{name}.json"))
6
+ )['version'].split('.')[0..1].join('.').prepend('~> ')
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Mkgem
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -16,7 +16,10 @@ Gem::Specification.new do |spec|
16
16
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
17
  spec.require_paths = ['lib']
18
18
 
19
- spec.add_development_dependency 'bundler'
20
- spec.add_development_dependency 'rake'
21
- spec.add_development_dependency 'pry'
19
+ spec.add_development_dependency 'bundler', '<%= Mkgem::Dependencies[:bundler] %>'
20
+ spec.add_development_dependency 'rake', '<%= Mkgem::Dependencies[:rake] %>'
21
+ spec.add_development_dependency 'pry', '<%= Mkgem::Dependencies[:pry] %>'
22
+ spec.add_development_dependency 'rspec', '<%= Mkgem::Dependencies[:rspec] %>'
23
+ spec.add_development_dependency 'rubocop', '<%= Mkgem::Dependencies[:rubocop] %>'
24
+ spec.add_development_dependency 'rubocop-rspec', '<%= Mkgem::Dependencies[:'rubocop-rspec'] %>'
22
25
  end
@@ -0,0 +1,2 @@
1
+ Style/Documentation:
2
+ Enabled: false
@@ -1 +1,15 @@
1
+ require 'bundler/setup'
1
2
  require 'bundler/gem_tasks'
3
+ require 'rspec/core/rake_task'
4
+ require 'rubocop/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ RuboCop::RakeTask.new(:rubocop) do |task|
9
+ task.fail_on_error = false
10
+ task.options = %w(--force-exclusion)
11
+ task.patterns = %w({lib,spec}/**/*.rb)
12
+ task.requires << 'rubocop-rspec'
13
+ end
14
+
15
+ task default: %w(spec rubocop)
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe <%= name.classify %> do
4
+ it 'works' do
5
+ expect(true).to be
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ require '<%= name %>'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tipugin
@@ -81,16 +81,20 @@ files:
81
81
  - exe/mkgem
82
82
  - lib/mkgem.rb
83
83
  - lib/mkgem/cli.rb
84
+ - lib/mkgem/dependencies.rb
84
85
  - lib/mkgem/version.rb
85
86
  - mkgem.gemspec
86
87
  - templates/gem/%name%.gemspec.tt
87
88
  - templates/gem/.gitignore
89
+ - templates/gem/.rubocop.yml
88
90
  - templates/gem/Gemfile
89
91
  - templates/gem/README.md.tt
90
92
  - templates/gem/Rakefile
91
93
  - templates/gem/bin/console.tt
92
94
  - templates/gem/lib/%name%.rb.tt
93
95
  - templates/gem/lib/%name%/version.rb.tt
96
+ - templates/gem/spec/lib/%name%_spec.rb.tt
97
+ - templates/gem/spec/spec_helper.rb.tt
94
98
  homepage: https://github.com/atipugin/mkgem
95
99
  licenses: []
96
100
  metadata: {}
@@ -110,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
114
  version: '0'
111
115
  requirements: []
112
116
  rubyforge_project:
113
- rubygems_version: 2.4.5.1
117
+ rubygems_version: 2.4.5
114
118
  signing_key:
115
119
  specification_version: 4
116
120
  summary: An opinionated Ruby gem generator