kaboom 0.3.1

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.
@@ -0,0 +1,107 @@
1
+ # boom changes
2
+ ## head
3
+ - [@Dlom](https://github.com/Dlom) fixed some troubles in #49.
4
+ - Some additional test coverage added by
5
+ [@nickhammond](https://github.com/nickhammond).
6
+
7
+ ## 0.2.3
8
+ - [@culvr](https://github.com/culvr) added `boom random <list>` that lets you
9
+ quickly pull a random item.
10
+ - Fixed so that opening a specific item (`boom open urls github`) will only
11
+ open that item.
12
+ - [@culvr](https://github.com/culvr) fixed STDIN list+item creation.
13
+ - HTTParty should only be a soft dependency. (#46)
14
+
15
+ ## 0.2.2 (July 29, 2011)
16
+ - [@jimmycuadra](https://github.com/jimmycuadra) went to town on this beast and
17
+ hooked up a Gist backend to boom. Killer.
18
+ - Small Windows fix.
19
+
20
+ ## 0.2.1 (July 16, 2011)
21
+ - boom displays colors thanks to [@dandorman](https://github.com/dandorman).
22
+ - Windows support, brah. [@tombell](https://github.com/tombell).
23
+ - boom accepts piped-in data (like `cat admins.txt | boom groups admins`).
24
+ Thanks [@brettbuddin](https://github.com/brettbuddin) and
25
+ [@antonlindstrom](https://github.com/antonlindstrom). Tag-team action.
26
+ - `boom <newlist> <item> <value>` will actually create the list and item now.
27
+ [@jmazzi](https://github.com/jmazzi).
28
+
29
+ ## 0.2.0 (April 12, 2011)
30
+ - Add Keychain storage to store Boom data securely in OS X's Keychain.app.
31
+ Thanks, [@davidtrogers](https://github.com/davidtrogers)!
32
+ - Switch from yajl-ruby because [OS X isn't for
33
+ developers](http://zachholman.com/2011/03/osx-isnt-for-developers/). Thanks
34
+ for finishing it up, [@antonlindstrom](https://github.com/antonlindstrom).
35
+ - Move dependencies to Bundler, because it's the One True Way™ at this point.
36
+ - Some README updates.
37
+ - `boom -v`.
38
+
39
+ ## 0.1.2
40
+ - Copy to clipboard doesn't hang anymore. Sweet. Thanks,
41
+ [mcollina](https://github.com/mcollina).
42
+ - Holy hell, [brettbuddin](https://github.com/brettbuddin) added completion for
43
+ zsh. Pretty awesome too.
44
+ - [antonlindstrom](https://github.com/antonlindstrom) fixed up the MongoDB
45
+ backend.
46
+
47
+ ## 0.1.1
48
+ - Don't force Redis on everyone.
49
+
50
+ ## 0.1.0
51
+ - boom has been rewritten to use multiple backends. Use `boom switch <backend>`
52
+ to switch from the default JSON backend. Currently only Redis is supported.
53
+ Pull Requests are welcome.
54
+
55
+ ## 0.0.10
56
+ - `boom open` will open the Item's URL in a browser, or it'll open all the URLs
57
+ in a List for you. Thanks [lwe](https://github.com/lwe).
58
+ - Values for item creation can have spaces, and then they get concat'ed as one
59
+ value. Thanks [lwe](https://github.com/lwe).
60
+ - Replacing an item no longer dupes the item; it'll just replace the value.
61
+ Thank god, finally. Thanks [thbishop](https://github.com/thbishop).
62
+ - Also started `completion/`, a place to drop in scripts to set up completion
63
+ support for boom. Starting out with [thbishop](https://github.com/thbishop)'s
64
+ bash script, but if anyone has something for zsh I'd kiss them a bit.
65
+ - `boom echo` (and `boom e`) just echos the value; great for command-line
66
+ scripts and junk! Thanks [bschaeffer](https://github.com/bschaeffer).
67
+
68
+ ## 0.0.9
69
+ - Backport `Symbol#to_proc` for 1.8.6 support (thanks
70
+ [kastner](https://github.com/kastner) and
71
+ [DeMarko](https://github.com/DeMarko)).
72
+
73
+ ## 0.0.8
74
+ - Support for Ruby 1.9 (thanks [jimmycuadra](https://github.com/jimmycuadra)).
75
+
76
+ ## 0.0.7
77
+ - Reverts item creation from stdin, since it broke regular item creation.
78
+
79
+ ## 0.0.6
80
+ - Searching for an item that doesn't exist doesn't murder puppies anymore
81
+ (thanks [jimmycuadra](https://github.com/jimmycuadra)).
82
+ - Output is a bit cleaner with a constrained `name` column.
83
+ - Adds items from stdin (thanks
84
+ [MichaelXavier](https://github.com/MichaelXavier)).
85
+
86
+ ## 0.0.5
87
+ - Item deletes are now scoped by list rather than GLOBAL DESTRUCTION! (thanks
88
+ [natebean](https://github.com/natebean)).
89
+ - Command line options, like `boop --help` are translated into `boom help`. In
90
+ the future we play around with options a bit more.
91
+ - Non-Mac-based platforms get clipboard support with `xclip`. If it's
92
+ problematic (which it almost certainly is; I'm breaking this more or less on
93
+ purpose), please patch it and send me a pull request for your particular
94
+ platform.
95
+
96
+ ## 0.0.4
97
+ - Adds `boom help`. You know, for help.
98
+
99
+ ## 0.0.3
100
+ - `boom edit` to edit your stuff in a friendly $EDITOR.
101
+ - Class-level accessors in List for ActiveRecordesque actions.
102
+
103
+ ## 0.0.2
104
+ - Fix for list selection (thanks [bgkittrell](https://github.com/bgkittrell)).
105
+
106
+ ## 0.0.1
107
+ - BOOM!
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "http://rubygems.org"
2
+ gemspec
@@ -0,0 +1,24 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ kaboom (0.3.1)
5
+ json_pure (~> 1.5.3)
6
+ multi_json (~> 1.0.3)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ json_pure (1.5.4)
12
+ spruz (~> 0.2.8)
13
+ mocha (0.9.12)
14
+ multi_json (1.0.4)
15
+ rake (0.9.2)
16
+ spruz (0.2.13)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ kaboom!
23
+ mocha (~> 0.9.9)
24
+ rake (~> 0.9.2)
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) Zach Holman, http://zachholman.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,74 @@
1
+ # K A B O O M
2
+
3
+ ## About
4
+
5
+ boom manages your text snippets. On the command line. I just blew your mind.
6
+ kaboom adds sharing snippets. On the command line.
7
+
8
+ For more details about what boom is and how it works, check out
9
+ [boom's website](http://holman.github.com/boom). For full usage details
10
+ (including a complete list of commands), check out
11
+ [boom's wiki](https://github.com/holman/boom/wiki).
12
+
13
+ ## Install
14
+
15
+ gem install kaboom
16
+
17
+ ## Quick and Dirty
18
+
19
+ $ boom gifs
20
+ Boom! Created a new list called "gifs".
21
+
22
+ $ boom gifs melissa http://cl.ly/3pAn/animated.gif
23
+ Boom! "melissa" in "gifs" is "http://cl.ly/3pAn/animated.gif". Got it.
24
+
25
+ $ boom melissa
26
+ Boom! Just copied http://cl.ly/3pAn/animated.gif to your clipboard.
27
+
28
+ And that's just a taste! I know, you're salivating, I can hear you from here.
29
+ (Why your saliva is noisy is beyond me.) Check out the [full list of
30
+ commands](https://github.com/holman/boom/wiki/Commands).
31
+
32
+ ## boom remote (or kaboom)
33
+ You can even have a remote boom using config in ~/.boom.remote.conf
34
+
35
+ $ boom remote "a sandwich" cheese "mighty fine"
36
+ Boom! cheese in a sandwich is mighty fine. Got it.
37
+
38
+ e.g. have a shared redis instance in the office for pinging around snippets to
39
+ each others command lines
40
+
41
+ # me:
42
+ $ kaboom config ackrc < ~/.ackrc
43
+
44
+ # you:
45
+ $ kaboom config ackrc > ~/.ackrc
46
+
47
+ ## Distributed sharing of snippets with boom and kaboom
48
+ # me:
49
+ $ kaboom shared_links pivotal < boom links pivotal
50
+
51
+ $ you:
52
+ $ kaboom shared_links pivotal > boom links pivotal
53
+
54
+ ## Contribute
55
+
56
+ Want to join the [Pantheon of
57
+ Boom'ers](https://github.com/holman/boom/contributors)? I'd love to include
58
+ your contributions, friend.
59
+
60
+ Clone this repository, then run `bundle install`. That'll install all the gem
61
+ dependencies. Make sure your methods are [TomDoc](http://tomdoc.org)'d
62
+ properly, that existing tests pass (`rake`), and that any new functionality
63
+ includes appropriate tests. Bonus points if you're not updating the gemspec or
64
+ bumping boom's version.
65
+
66
+ All good? Cool! Then [send me a pull request](https://github.com/holman/boom/pull/new/master)!
67
+
68
+ ## I love you
69
+
70
+ [Zach Holman](http://zachholman.com) made this. Ping me on Twitter —
71
+ [@holman](http://twitter.com/holman) — if you're having issues, want me to
72
+ merge in your pull request, or are using boom in a cool way. I'm kind of hoping
73
+ this is generic enough that people do some fun things with it. First one to use
74
+ `boom` to calculate their tax liability wins.
@@ -0,0 +1,150 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'date'
4
+
5
+ #############################################################################
6
+ #
7
+ # Helper functions
8
+ #
9
+ #############################################################################
10
+
11
+ def name
12
+ @name ||= Dir['*.gemspec'].first.split('.').first
13
+ end
14
+
15
+ def version
16
+ line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
17
+ line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
18
+ end
19
+
20
+ def date
21
+ Date.today.to_s
22
+ end
23
+
24
+ def rubyforge_project
25
+ name
26
+ end
27
+
28
+ def gemspec_file
29
+ "#{name}.gemspec"
30
+ end
31
+
32
+ def gem_file
33
+ "#{name}-#{version}.gem"
34
+ end
35
+
36
+ def replace_header(head, header_name)
37
+ head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
38
+ end
39
+
40
+ #############################################################################
41
+ #
42
+ # Standard tasks
43
+ #
44
+ #############################################################################
45
+
46
+ task :default => :test
47
+
48
+ require 'rake/testtask'
49
+ Rake::TestTask.new(:test) do |test|
50
+ test.libs << 'lib' << 'test'
51
+ test.pattern = 'test/**/test_*.rb'
52
+ test.verbose = true
53
+ end
54
+
55
+ desc "Generate RCov test coverage and open in your browser"
56
+ task :coverage do
57
+ require 'rcov'
58
+ sh "rm -fr coverage"
59
+ sh "rcov test/test_*.rb"
60
+ sh "open coverage/index.html"
61
+ end
62
+
63
+ require 'rake/rdoctask'
64
+ Rake::RDocTask.new do |rdoc|
65
+ rdoc.rdoc_dir = 'rdoc'
66
+ rdoc.title = "#{name} #{version}"
67
+ rdoc.rdoc_files.include('README*')
68
+ rdoc.rdoc_files.include('lib/**/*.rb')
69
+ end
70
+
71
+ desc "Open an irb session preloaded with this library"
72
+ task :console do
73
+ sh "irb -rubygems -r ./lib/#{name}.rb"
74
+ end
75
+
76
+ #############################################################################
77
+ #
78
+ # Custom tasks (add your own tasks here)
79
+ #
80
+ #############################################################################
81
+
82
+
83
+
84
+ #############################################################################
85
+ #
86
+ # Packaging tasks
87
+ #
88
+ #############################################################################
89
+
90
+ desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
91
+ task :release => :build do
92
+ unless `git branch` =~ /^\* master$/
93
+ puts "You must be on the master branch to release!"
94
+ exit!
95
+ end
96
+ sh "git commit --allow-empty -a -m 'Release #{version}'"
97
+ sh "git tag v#{version}"
98
+ sh "git push origin master"
99
+ sh "git push origin v#{version}"
100
+ sh "gem push pkg/#{name}-#{version}.gem"
101
+ end
102
+
103
+ desc "Build #{gem_file} into the pkg directory"
104
+ task :build => :gemspec do
105
+ sh "mkdir -p pkg"
106
+ sh "gem build #{gemspec_file}"
107
+ sh "mv #{gem_file} pkg"
108
+ end
109
+
110
+ desc "Generate #{gemspec_file}"
111
+ task :gemspec => :validate do
112
+ # read spec file and split out manifest section
113
+ spec = File.read(gemspec_file)
114
+ head, manifest, tail = spec.split(" # = MANIFEST =\n")
115
+
116
+ # replace name version and date
117
+ replace_header(head, :name)
118
+ replace_header(head, :version)
119
+ replace_header(head, :date)
120
+ #comment this out if your rubyforge_project has a different name
121
+ #replace_header(head, :rubyforge_project)
122
+
123
+ # determine file list from git ls-files
124
+ files = `git ls-files`.
125
+ split("\n").
126
+ sort.
127
+ reject { |file| file =~ /^\./ }.
128
+ reject { |file| file =~ /^(rdoc|pkg)/ }.
129
+ map { |file| " #{file}" }.
130
+ join("\n")
131
+
132
+ # piece file back together and write
133
+ manifest = " s.files = %w[\n#{files}\n ]\n"
134
+ spec = [head, manifest, tail].join(" # = MANIFEST =\n")
135
+ File.open(gemspec_file, 'w') { |io| io.write(spec) }
136
+ puts "Updated #{gemspec_file}"
137
+ end
138
+
139
+ desc "Validate #{gemspec_file}"
140
+ task :validate do
141
+ libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}"]
142
+ unless libfiles.empty?
143
+ puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
144
+ exit!
145
+ end
146
+ unless Dir['VERSION*'].empty?
147
+ puts "A `VERSION` file at root level violates Gem best practices."
148
+ exit!
149
+ end
150
+ end
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # coding: utf-8
3
+
4
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
5
+
6
+ require 'boom'
7
+
8
+ Boom::Command.execute(*ARGV)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # coding: utf-8
3
+
4
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
5
+
6
+ require 'boom'
7
+ args = %w{remote} + ARGV
8
+ Boom::Command.execute(*args)
@@ -0,0 +1,7 @@
1
+ # boom completion
2
+
3
+ To add autocompletion to your shell, look in this directory and grab the script
4
+ that matches your corresponding shell.
5
+
6
+ I use the Z shell, so hey, I picked `boom.zsh`. And trust me: after a couple minutes of
7
+ playing with it, you'll never look back. NEVER!
@@ -0,0 +1,17 @@
1
+ _boom_complete() {
2
+ local cur prev lists curr_list items
3
+ COMPREPLY=()
4
+ cur="${COMP_WORDS[COMP_CWORD]}"
5
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
6
+ curr_list=`eval echo "$prev"`
7
+ local IFS=$'\n'
8
+
9
+ if [ $COMP_CWORD -eq 1 ]; then
10
+ lists=`boom | sed 's/^ \(.*\) ([0-9]\+)$/\1/'`
11
+ COMPREPLY=( $( compgen -W '${lists}' -- ${cur} ) )
12
+ elif [ $COMP_CWORD -eq 2 ]; then
13
+ items=`boom $curr_list | sed 's/^ \(.\{0,16\}\):.*$/\1/'`
14
+ COMPREPLY=( $( compgen -W '${items}' -- ${cur} ) )
15
+ fi
16
+ }
17
+ complete -o filenames -F _boom_complete boom
@@ -0,0 +1,29 @@
1
+ #compdef boom
2
+
3
+ local state line cmds ret=1
4
+
5
+ _arguments -C '1: :->cmds' '*: :->args'
6
+
7
+ case $state in
8
+ cmds)
9
+ local -a cmds
10
+ cmds=(
11
+ 'all:show all items in all lists'
12
+ 'edit:edit the boom JSON file in $EDITOR'
13
+ 'help:help text'
14
+ )
15
+ _describe -t commands 'boom command' cmds && ret=0
16
+ _values 'lists' $(boom | awk '{print $1}')
17
+ ;;
18
+ args)
19
+ case $line[1] in
20
+ (boom|all|edit|help)
21
+ ;;
22
+ *)
23
+ _values 'items' `boom $line[1] | awk '{print $1}' | sed -e 's/://'` 2>/dev/null && ret=0
24
+ ;;
25
+ esac
26
+ ;;
27
+ esac
28
+
29
+ return ret