swissknife 0.0.4 → 0.0.5
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/README.md +5 -2
- data/bin/{crystallize → clean} +1 -1
- data/bin/gita +0 -0
- data/bin/install +5 -0
- data/lib/swissknife.rb +33 -29
- data/swissknife.gemspec +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14e8216a82705c75c59c55f6f3a0ef75c0516ded
|
4
|
+
data.tar.gz: 5d256347fe8e500d775d1b93685a546e74ece777
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ba0ddf6eb5dcec7c5217a8c31608fd9a1818c832d97edbf222f9a48361e7dd701066b55df6988abdedfad993a370553b0004af5377fe69e5ada56f51121535f
|
7
|
+
data.tar.gz: ab062382bde1486f3a51e489f196541facf0567521b3cb2d7e5271d219c633e76550367b9b9c52d6d909e80825fb93dcb9df12c4f8697a4a4f47ab3ada190885
|
data/README.md
CHANGED
@@ -32,8 +32,11 @@ SwissKnife::Util.new.hello
|
|
32
32
|
| Command | Description |
|
33
33
|
|:-------:|:-----------:|
|
34
34
|
| x | Exits a console |
|
35
|
-
| c | Clears the console screen (puts the cursor on the bottom for easy console browsing)|
|
36
|
-
| pack | Bundles a Ruby project's dependencies to `vendor/bundle
|
35
|
+
| c | Clears the console screen (puts the cursor on the bottom for easy console browsing) |
|
36
|
+
| pack | Bundles a Ruby project's dependencies to `vendor/bundle` |
|
37
|
+
| gita | Basically just like `git add`, but with the added advantage of having the `-A` option when no files are specified |
|
38
|
+
| clean | Removes some of the junk we all encounter, such as the `.DS_Store` |
|
39
|
+
| install | A sleek command to install popular Ruby programs (currently only Homebrew and RVM [will install the latest Ruby w/ RVM]) |
|
37
40
|
|
38
41
|
## Contributing
|
39
42
|
1. Fork it
|
data/bin/{crystallize → clean}
RENAMED
data/bin/gita
CHANGED
File without changes
|
data/bin/install
ADDED
data/lib/swissknife.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'fileutils'
|
1
2
|
require 'git'
|
2
3
|
require 'rubygems'
|
3
4
|
|
@@ -19,35 +20,6 @@ module SwissKnife
|
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
22
|
-
def crystallize
|
23
|
-
# first let's get the gem's name
|
24
|
-
searcher = if Gem::Specification.respond_to? :find
|
25
|
-
Gem::Specification # ruby 2.0
|
26
|
-
elsif Gem.respond_to? :searcher
|
27
|
-
Gem.searcher.init_gemspecs # ruby 1.8/1.9
|
28
|
-
end
|
29
|
-
gemspec = unless searcher.nil?
|
30
|
-
searcher.find do |spec|
|
31
|
-
File.fnmatch(File.join(spec.full_gem_path, '*'), __FILE__)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
version = unless searcher.nil?
|
35
|
-
searcher.find do |spec|
|
36
|
-
return spec.version
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
if system 'rake build'
|
41
|
-
if system "gem install pkg/#{gemspec}-#{version}"
|
42
|
-
puts "\nGem installed successfully!"
|
43
|
-
else
|
44
|
-
puts "\nYou probably weren't in the project's root, right?"
|
45
|
-
end
|
46
|
-
else
|
47
|
-
puts "\nYou probably need Rake installed."
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
23
|
def git_add(filepath)
|
52
24
|
git = Git.open Dir.pwd
|
53
25
|
|
@@ -57,5 +29,37 @@ module SwissKnife
|
|
57
29
|
git.add filepath
|
58
30
|
end
|
59
31
|
end
|
32
|
+
|
33
|
+
def clean
|
34
|
+
junk = %w(.DS_Store _MACOSX Thumbs.db)
|
35
|
+
junk.each do |litter|
|
36
|
+
FileUtils.rm_rf litter
|
37
|
+
puts "Removed #{litter}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def install_homebrew
|
42
|
+
system 'ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"'
|
43
|
+
end
|
44
|
+
|
45
|
+
def install_rvm
|
46
|
+
system 'curl -sSL https://get.rvm.io | bash -s stable --ruby'
|
47
|
+
end
|
48
|
+
|
49
|
+
def install(program)
|
50
|
+
case program
|
51
|
+
when 'homebrew' || 'brew'
|
52
|
+
install_homebrew
|
53
|
+
when 'rvm'
|
54
|
+
if system 'brew doctor'
|
55
|
+
install_rvm
|
56
|
+
else
|
57
|
+
install_homebrew
|
58
|
+
install_rvm
|
59
|
+
end
|
60
|
+
else
|
61
|
+
puts "I don't know what #{program} is!"
|
62
|
+
end
|
63
|
+
end
|
60
64
|
end
|
61
65
|
end
|
data/swissknife.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'swissknife'
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.5'
|
8
8
|
spec.authors = ['Taylor Shuler']
|
9
9
|
spec.email = ['gnosoman@gmail.com']
|
10
10
|
spec.summary = %q{A simple gem with sneaky commands!}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swissknife
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Shuler
|
@@ -71,8 +71,9 @@ email:
|
|
71
71
|
- gnosoman@gmail.com
|
72
72
|
executables:
|
73
73
|
- c
|
74
|
-
-
|
74
|
+
- clean
|
75
75
|
- gita
|
76
|
+
- install
|
76
77
|
- pack
|
77
78
|
- x
|
78
79
|
extensions: []
|
@@ -84,8 +85,9 @@ files:
|
|
84
85
|
- README.md
|
85
86
|
- Rakefile
|
86
87
|
- bin/c
|
87
|
-
- bin/
|
88
|
+
- bin/clean
|
88
89
|
- bin/gita
|
90
|
+
- bin/install
|
89
91
|
- bin/pack
|
90
92
|
- bin/x
|
91
93
|
- lib/swissknife.rb
|