joe_utils 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
- data/bin/gem_utility.rb +61 -0
- data/joe_utils.gemspec +2 -2
- metadata +3 -3
- data/bin/gem_util +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 096c43fd76194f9d3dc7ed672d363cd0bd876f3f
|
4
|
+
data.tar.gz: 15da32ac282f5de572042e609f9103c6e3e2281a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c84c415dec82359d08025b401ae45e2c0ae00e95dd632d92dd4327eb54b30dc595f0ac8e824fe9d84357a8b4903795c65bfbf2b3528dc45d6db728d283d1d5c
|
7
|
+
data.tar.gz: c1065dd69cbe2356e99c38b315db670e4038f2deade19bcc582a7efe2a4193e2794424bb251c4f8c0065b05d0e7df186b7612e688e5e1365953db4c83e0ef8a1
|
data/bin/gem_utility.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
HELP_TEXT = 'Provide me with the name of the gem, you also can add options:
|
4
|
+
i for installing the gem locally, p for pushing the gem to rubygems.org, h for help.'
|
5
|
+
|
6
|
+
def print_help
|
7
|
+
puts HELP_TEXT
|
8
|
+
end
|
9
|
+
|
10
|
+
gem_name = install = push = nil
|
11
|
+
|
12
|
+
ARGV.each do |arg|
|
13
|
+
case arg
|
14
|
+
when '-i', '--install'
|
15
|
+
install = true
|
16
|
+
when '-p', '--push'
|
17
|
+
push = true
|
18
|
+
when '-h', '--help'
|
19
|
+
print_help
|
20
|
+
when '-ip'
|
21
|
+
install = true
|
22
|
+
push = true
|
23
|
+
else
|
24
|
+
gem_name = arg
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
puts 'Commiting...'
|
29
|
+
|
30
|
+
`git add -u`
|
31
|
+
`git commit -m "Build gem version"`
|
32
|
+
|
33
|
+
puts 'Building...'
|
34
|
+
|
35
|
+
# if the gem name has not been defined, print error message and exit
|
36
|
+
if gem_name
|
37
|
+
# run the gem build and parse for the gem release filename
|
38
|
+
gem_build_name = `gem build "#{gem_name}.gemspec"`
|
39
|
+
gem_build_name = gem_build_name.match(/File: /).post_match
|
40
|
+
|
41
|
+
# if the build failed (i.e. no file name obtained above), print error message and exit
|
42
|
+
if gem_build_name
|
43
|
+
puts 'Built successful'
|
44
|
+
# if above succeeded, then push to rubygems.org using the gem that was compiled
|
45
|
+
if push
|
46
|
+
puts 'Pushing...'
|
47
|
+
`gem push #{gem_build_name}`
|
48
|
+
end
|
49
|
+
# install it locally
|
50
|
+
if install
|
51
|
+
puts 'Installing...'
|
52
|
+
`gem install #{gem_build_name}`
|
53
|
+
`jgem install #{gem_build_name}`
|
54
|
+
end
|
55
|
+
else
|
56
|
+
puts 'The gem build failed. Please confirm the gem name and try again.'
|
57
|
+
end
|
58
|
+
else
|
59
|
+
puts 'You did not enter a gem name.
|
60
|
+
Please include it as an argument to the script or hard code it as a variable in the script.'
|
61
|
+
end
|
data/joe_utils.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'joe_utils'
|
3
|
-
s.version = '0.0.
|
4
|
-
s.executables = %w(
|
3
|
+
s.version = '0.0.6'
|
4
|
+
s.executables = %w(gem_utility.rb)
|
5
5
|
|
6
6
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
7
7
|
s.authors = ['Josef Erneker']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: joe_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Erneker
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
description: Overall personal utils gem
|
28
28
|
email: josef.erneker@gmail.com
|
29
29
|
executables:
|
30
|
-
-
|
30
|
+
- gem_utility.rb
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
@@ -40,7 +40,7 @@ files:
|
|
40
40
|
- .idea/scopes/scope_settings.xml
|
41
41
|
- .idea/vcs.xml
|
42
42
|
- Rakefile
|
43
|
-
- bin/
|
43
|
+
- bin/gem_utility.rb
|
44
44
|
- joe_utils.gemspec
|
45
45
|
- lib/joe_utils.rb
|
46
46
|
- lib/joe_utils/Script.rb
|
data/bin/gem_util
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
# Create a Ruby gem and push it to rubygems.org and update it locally
|
4
|
-
|
5
|
-
GEMSPEC_SUFFIX=".gemspec"
|
6
|
-
|
7
|
-
function usage
|
8
|
-
{
|
9
|
-
echo "usage: system_page [[[-p push] [-i install]] | [-h]]"
|
10
|
-
}
|
11
|
-
|
12
|
-
# checking options of the script and name of the gem to work with
|
13
|
-
while [ "$1" != "" ]; do
|
14
|
-
case $1 in
|
15
|
-
-i | --install ) INSTALL=1
|
16
|
-
;;
|
17
|
-
-p | --push ) PUSH=1
|
18
|
-
;;
|
19
|
-
-h | --help ) usage
|
20
|
-
;;
|
21
|
-
-ip ) INSTALL=1
|
22
|
-
PUSH=1
|
23
|
-
;;
|
24
|
-
* ) GEM_NAME=$1
|
25
|
-
esac
|
26
|
-
shift
|
27
|
-
done
|
28
|
-
|
29
|
-
echo "Commiting..."
|
30
|
-
|
31
|
-
git add -u
|
32
|
-
git commit -m "Build gem version"
|
33
|
-
|
34
|
-
echo "Building..."
|
35
|
-
|
36
|
-
# if the gem name has not been defined, print error message and exit
|
37
|
-
if [ -z "$GEM_NAME" ]; then
|
38
|
-
echo "You did not enter a gem name. Please include it as an argument to the script or hard code it as a variable in the script." >&2
|
39
|
-
exit 1
|
40
|
-
fi
|
41
|
-
|
42
|
-
# run the gem build and parse for the gem release filename
|
43
|
-
GEM_BUILD_NAME=$(gem build "$GEM_NAME$GEMSPEC_SUFFIX" | awk '/File/ {print $2}' -)
|
44
|
-
|
45
|
-
# if the build failed (i.e. no file name obtained above), print error message and exit
|
46
|
-
if [ -z "$GEM_BUILD_NAME" ]; then
|
47
|
-
echo "The gem build failed. Please confirm the gem name and try again." >&2
|
48
|
-
exit 1
|
49
|
-
else
|
50
|
-
echo "Built successful"
|
51
|
-
fi
|
52
|
-
|
53
|
-
# if above succeeded, then push to rubygems.org using the gem that was compiled
|
54
|
-
if [ "$PUSH" ]; then
|
55
|
-
echo "Pushing..."
|
56
|
-
gem push "$GEM_BUILD_NAME"
|
57
|
-
fi
|
58
|
-
|
59
|
-
# install it locally
|
60
|
-
if [ "$INSTALL" ]; then
|
61
|
-
echo "Installing..."
|
62
|
-
gem install "$GEM_BUILD_NAME"
|
63
|
-
jgem install "$GEM_BUILD_NAME"
|
64
|
-
fi
|
65
|
-
|
66
|
-
exit 0
|