run-gem-dev 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -3
- data/lib/run-gem-dev/tasks.rb +56 -48
- data/lib/run-gem-dev/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8384400d2fed3a7e13b975cc131cd24725566d7b
|
4
|
+
data.tar.gz: b511593f4c8a460b038876d547ae12da884c463c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e60c0c146e5671db7e492055c337171b1f6c1f7a06ccbcb622dab6e4c59b43bfedd4d9f52380e6cf0f1e1d19b6ddc9ea8a1d2cd6bdce6697a098da9d6785e1e
|
7
|
+
data.tar.gz: 192a6ed53997c7cfb9a11a1e44f4238ef46a35668c985bb9f554ed60e14780236907cca4aa876e259cd4def5800da4256ec0a78a1bc42c8ef747c12af2cb9799
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
Run Gem Dev
|
2
2
|
===========
|
3
3
|
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/run-gem-dev.svg)](http://badge.fury.io/rb/run-gem-dev)
|
5
|
+
|
4
6
|
[Runfile](https://github.com/DannyBen/runfile) tasks for gem developers.
|
5
7
|
|
6
8
|
## Install
|
@@ -12,12 +14,28 @@ Run Gem Dev
|
|
12
14
|
Put this in your Runfile
|
13
15
|
|
14
16
|
```ruby
|
15
|
-
|
17
|
+
require "run-gem-dev"
|
18
|
+
|
19
|
+
name "My Gem Runfile"
|
20
|
+
summary "Tasks for my gem"
|
21
|
+
version "0.1.0"
|
22
|
+
|
23
|
+
RunGemDev::Tasks.embed 'run-gem-dev'
|
24
|
+
|
25
|
+
# Your other tasks here
|
26
|
+
|
16
27
|
```
|
17
28
|
|
29
|
+
## Available Tasks
|
30
|
+
|
31
|
+
run gem build [<folder>]
|
32
|
+
run gem install
|
33
|
+
run gem publish
|
34
|
+
run gem yank [<version>]
|
35
|
+
run gem test [<name>]
|
36
|
+
|
18
37
|
|
19
38
|
## Todo
|
20
39
|
|
21
40
|
- Docs
|
22
|
-
-
|
23
|
-
- Yank `gem yank gemname -v 0.1.0`
|
41
|
+
- Add `init` (scaffold gemspec and folders)
|
data/lib/run-gem-dev/tasks.rb
CHANGED
@@ -1,53 +1,61 @@
|
|
1
1
|
|
2
2
|
module RunGemDev
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
system cmd
|
39
|
-
end
|
40
|
-
|
41
|
-
usage "test [<name>]"
|
42
|
-
help "Run all tests or a single test file"
|
43
|
-
action :test do |args|
|
44
|
-
name = args['<name>'] || "*"
|
45
|
-
cmd = "ruby -Itest test/test_#{name}.rb"
|
46
|
-
say "Running #{cmd}"
|
47
|
-
system cmd
|
48
|
-
end
|
49
|
-
|
50
|
-
endcommand
|
3
|
+
def self.tasks(gemname, gemdir="gems")
|
4
|
+
command "gem"
|
5
|
+
|
6
|
+
spec = Gem::Specification::load "#{gemname}.gemspec"
|
7
|
+
spec or abort "Error loading #{gemname}.gemspec"
|
8
|
+
gemver = spec.version.to_s
|
9
|
+
|
10
|
+
usage "build [--install]"
|
11
|
+
help "Build gem from gemspec and move it to '#{gemdir}' folder.\nUse --install to also install it."
|
12
|
+
action :build do |args|
|
13
|
+
say "Building gem..."
|
14
|
+
cmd = "gem build #{gemname}.gemspec"
|
15
|
+
say "Running: #{cmd}"
|
16
|
+
system cmd
|
17
|
+
say "Moving to #{gemdir}..."
|
18
|
+
files = Dir["*.gem"]
|
19
|
+
files.each {|f| FileUtils.mv f, gemdir }
|
20
|
+
args['--install'] and call "gem install"
|
21
|
+
end
|
22
|
+
|
23
|
+
help "Install local gem"
|
24
|
+
action :install do
|
25
|
+
gemfile = "gems/#{gemname}-#{gemver}.gem"
|
26
|
+
cmd = "gem install #{gemfile}"
|
27
|
+
say "Running: #{cmd}"
|
28
|
+
system cmd
|
29
|
+
end
|
30
|
+
|
31
|
+
help "Publish gem to rubygems"
|
32
|
+
action :publish do
|
33
|
+
gemfile = "gems/#{gemname}-#{gemver}.gem"
|
34
|
+
File.exist? gemfile or abort "File not found #{gemfile}"
|
35
|
+
cmd = "gem push #{gemfile}"
|
36
|
+
say "Running: #{cmd}"
|
37
|
+
system cmd
|
51
38
|
end
|
39
|
+
|
40
|
+
usage "yank [<version>]"
|
41
|
+
help "Yank gem from rubygems"
|
42
|
+
action :yank do |args|
|
43
|
+
ver = args['<version>'] || gemver
|
44
|
+
cmd = "gem yank #{gemname} -v #{ver}"
|
45
|
+
say "Running: #{cmd}"
|
46
|
+
system cmd
|
47
|
+
end
|
48
|
+
|
49
|
+
usage "test [<name>]"
|
50
|
+
help "Run all tests or a single test file"
|
51
|
+
action :test do |args|
|
52
|
+
name = args['<name>'] || "*"
|
53
|
+
cmd = "ruby -Itest test/test_#{name}.rb"
|
54
|
+
say "Running: #{cmd}"
|
55
|
+
system cmd
|
56
|
+
end
|
57
|
+
|
58
|
+
endcommand
|
52
59
|
end
|
60
|
+
|
53
61
|
end
|
data/lib/run-gem-dev/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: run-gem-dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: runfile
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: colsole
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: A collection of gem related tasks for Runfile
|
42
56
|
email: db@dannyben.com
|
43
57
|
executables: []
|