creategem 0.6.0 → 0.7.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: 317d9529abf350df568ce941c8ee84d1b733b253
4
- data.tar.gz: 02ae19272e3c3c6952a78b300515cbd992b42936
3
+ metadata.gz: 165dcd90735d552212a261bbb75d2ba82f0fa819
4
+ data.tar.gz: cdb88b468ca75e5c0c3ce08a17d94d422a1b92d5
5
5
  SHA512:
6
- metadata.gz: dfd8d9e7669fd7139b83c9db7f21a9453cf9bf9fc6dd459b459cae94633c41ded395bc9026ead5a6dc2437c2ca7d09734cb1acdea187f4110e91b14a74c23d3b
7
- data.tar.gz: 1fccdadc3a6a571493c07bc18a939c3485281dcaa43992eaf20082582957b17ccd7f43124e5a34ba172a0e59e6f0ac433a8878d8cd2431559990eef8a75c573f
6
+ metadata.gz: b407619f8ed1179ab40055207e8812592f5725adef8e764f1c2bc9eac1ca777ef6499939c16705e6576492665648fa8a9d90c625fbf775283b5d29eac050004d
7
+ data.tar.gz: 71db9e8cf55f378150de2ba435ec5a7dc6d2ac7bb6dda25e0758e0d428c1a87b98f0d36ecddfe5d1d146c999fc900309a339005a46ce7ce85fb9b346cfce1cb1
data/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  Creategem creates a scaffold project for a new gem together with remote repository (Github or Bitbucket) and is ready to be released in a public or private gem server.
16
16
 
17
- This project is inspired by the [Bundler](http://bundler.io)'s `bundle gem GEM` command and by the great article [Deveoping a RubyGem using Bundler](https://github.com/radar/guides/blob/master/gem-development.md).
17
+ This project was inspired by the [Bundler](http://bundler.io)'s `bundle gem GEM` command and by the great article [Deveoping a RubyGem using Bundler](https://github.com/radar/guides/blob/master/gem-development.md).
18
18
 
19
19
  Similar to what Bundler's bundle gem command does, this gem generates a scaffold with all files you need to start, but it also has some additional features.
20
20
 
@@ -24,7 +24,8 @@ Features:
24
24
  - automatically release patches, minor and major versions without having to manually increase versions (thanks to [gem-release](https://github.com/svenfuchs/gem-release))
25
25
  - executable based on [Thor](http://whatisthor.com) (can be omited with --no-executable)
26
26
  - test infrastructure based on minitest and minitest-reporters
27
- - release to rubygems.org or to a private geminabox gem server
27
+ - release to rubygems.org or to private geminabox gem server
28
+ - optionaly create rails plugin gem with (mountable) engine
28
29
  - readme with badges for travis, codeclimate, coveralls, etc. for public projects (like the badges you see above)
29
30
 
30
31
 
@@ -39,18 +40,16 @@ Features:
39
40
 
40
41
  When called without any options it is assumed that you want a gem with an executable and hosted in a public github git repository, and released to rubygems.org.
41
42
 
42
- During the creation you will be asked for your github or bitbucket user name (only the first time, as the user name is saved in your git global config). You will also be asked to enter your github or bitbucket password when the remote repository is created for you with the rest api.
43
+ During the creation you will be asked for your github or bitbucket user name (only the first time, as the user name is saved in your git global config). You will also be asked to enter your github or bitbucket password when the remote repository is created for you.
43
44
 
44
- When you use the `--private` option, a private github or bitbucket repository is created for the gem and on release the gem is pushed to a private geminabox server. During the creation you will be asked for the url of your geminabox gem server (only the first time, as the gem server url is saved in your git global config).
45
-
46
- When you specify the `--bitbucket` option, a bitbucket repository is created instead of github (default)
45
+ When you use the `--private` option a remote repository is made private and on release the gem is pushed to a private Geminabox server.
47
46
 
48
47
  Per default a gem is created with an executable based on Thor, but you can omit the executable with the option `--no-executable`.
49
48
 
50
49
  After you create the gem, edit your gemspec and change the summary and the description, commit the changes to git and invoke `rake release_patch` and your gem is being released.
51
50
 
52
51
 
53
- $ creategem plugin GEM_NAME [--engine] [--mountable] [--private] [--bitbucket] [--executable]
52
+ $ creategem plugin GEM_NAME [--engine] [--mountable] [--private] [--executable]
54
53
 
55
54
  `creategem plugin` creates a rails plugin. You can also specify if the plugin should be an engine (`--engine`) or a mountable engine (`--mountable`).
56
55
 
data/lib/creategem/cli.rb CHANGED
@@ -16,23 +16,21 @@ module Creategem
16
16
  File.expand_path('../../../templates', __FILE__)
17
17
  end
18
18
 
19
- desc "gem NAME", "Creates a new gem with a given NAME with Github git repository; Options: --private (Bitbucket/Geminabox), --no-executable"
20
- option :private, type: :boolean, default: false, desc: "When true, Bitbucket and Geminabox are used, otherwise Github and Rubygems are used (default)"
19
+ desc "gem NAME", "Creates a new gem with a given NAME with Github git repository; Options: --private (Geminabox), --no-executable, --bitbucket"
20
+ option :private, type: :boolean, default: false, desc: "When true, gem is published in a private geminabox repository, otherwise gem is published to Rubygems (default)"
21
21
  option :executable, type: :boolean, default: true, desc: "When true, gem with executable is created"
22
- option :github, type: :boolean, default: true, desc: "When true, Github remote repository is created (default)"
23
- option :bitbucket, type: :boolean, default: false, desc: "When true, Bitbucket remote repository is created"
22
+ option :bitbucket, type: :boolean, default: false, desc: "When true, bitbucket repository is created, otherwise Github (default)"
24
23
  def gem(gem_name)
25
24
  create_gem_scaffold(gem_name)
26
25
  initialize_repository(gem_name)
27
26
  end
28
27
 
29
- desc "plugin NAME", "Creates a new rails plugin with a given NAME with Github git repository; Options: --private (Bitbucket/Geminabox), --executable, --engine, --mountable"
30
- option :private, type: :boolean, default: false, desc: "When true, Bitbucket and Geminabox are used, otherwise Github and Rubygems are used (default)"
28
+ desc "plugin NAME", "Creates a new rails plugin with a given NAME with Github git repository; Options: --private (Geminabox), --executable, --engine, --mountable, --bitbucket"
29
+ option :private, type: :boolean, default: false, desc: "When true, gem is published in a private geminabox repository, otherwise gem is published to Rubygems (default)"
31
30
  option :engine, type: :boolean, default: false, desc: "When true, gem with rails engine is created"
32
31
  option :mountable, type: :boolean, default: false, desc: "When true, gem with mountable rails engine is created"
33
32
  option :executable, type: :boolean, default: false, desc: "When true, gem with executable is created"
34
- option :github, type: :boolean, default: true, desc: "When true, Github remote repository is created (default)"
35
- option :bitbucket, type: :boolean, default: false, desc: "When true, Bitbucket remote repository is created"
33
+ option :bitbucket, type: :boolean, default: false, desc: "When true, bitbucket repository is created, otherwise Github (default)"
36
34
  def plugin(gem_name)
37
35
  @plugin = true
38
36
  @engine = options[:engine] || options[:mountable]
@@ -51,12 +49,12 @@ module Creategem
51
49
  @gem_name = gem_name
52
50
  @class_name = Thor::Util.camel_case(gem_name.gsub("-", "_"))
53
51
  @executable = options[:executable]
54
- @vendor = options[:bitbucket] ? :bitbucket : :github
52
+ @vendor = options[:private] ? :bitbucket : :github
55
53
  @repository = Creategem::Repository.new(vendor: @vendor,
56
- private: options[:private],
57
54
  user: git_repository_user_name(@vendor),
58
55
  name: gem_name,
59
- gem_server_url: gem_server_url(options[:private]))
56
+ gem_server_url: gem_server_url(@vendor),
57
+ private: options[:private])
60
58
  directory "gem_scaffold", gem_name
61
59
  if @executable
62
60
  directory "executable_scaffold", gem_name
data/lib/creategem/git.rb CHANGED
@@ -15,7 +15,7 @@ module Creategem
15
15
  say "Create remote #{repository.vendor} repository", :green
16
16
  if repository.github?
17
17
  token = ask("What is yout Github personal access token?")
18
- run "curl -u #{repository.user}:#{token} https://api.github.com/user/repos -d '{\"name\":\"#{repository.name}\", \"private\":\"#{repository.private}\"}'"
18
+ run "curl --request POST --user #{repository.user}:#{token} https://api.github.com/user/repos --data name=#{repository.name} --data private=#{repository.private?}"
19
19
  else # bitbucket
20
20
  run "curl --request POST --user #{repository.user} https://api.bitbucket.org/1.0/repositories/ --data name=#{repository.name} --data scm=git --data is_private=#{repository.private}"
21
21
  end
@@ -15,6 +15,7 @@ module Creategem
15
15
  @user_name = ::Git.global_config "user.name"
16
16
  @user_email = ::Git.global_config "user.email"
17
17
  @gem_server_url = options[:gem_server_url]
18
+ @private = options[:private]
18
19
  end
19
20
 
20
21
  def github?
@@ -27,7 +28,7 @@ module Creategem
27
28
 
28
29
  # this could change later. For now all private repositories are on bitbucket and all private ones on github
29
30
  def private?
30
- bitbucket?
31
+ self.private
31
32
  end
32
33
 
33
34
  def public?
@@ -1,3 +1,3 @@
1
1
  module Creategem
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: creategem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Jancev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-01 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: bundler