boom 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f18689671b94477007ee26cc349fe951824fa015
4
+ data.tar.gz: 55cdbbad2f0e6abd88e4dda059a59ea1d9a258f0
5
+ SHA512:
6
+ metadata.gz: e7f03fabc4d6fd6a0f4719119407e1a1502a58c9523465a7904df8fa6b740e2f5151cb4d40d0b951f551c4773b2bfe80233b083acdac47a4ba2541a2718d4c03
7
+ data.tar.gz: 57ceba5b3b8914d2bde2d2fa128b462b40d3f17f5bd782c6f375a13352e23e24fe0e1889b8670402116c219946960e752dfbab5b9fd0e3176ce29fc1e51553ca
@@ -1,6 +1,9 @@
1
1
  # boom changes
2
2
  ## head
3
3
 
4
+ ## 0.5.0
5
+ - Bump Ruby versions and gems. ([@wjzijderveld](https://github.com/holman/boom/pull/115), #115).
6
+
4
7
  ## 0.4.0
5
8
  - Returns an error if you try to `open` something that doesn't exist.
6
9
  ([@romainberger](https://github.com/romainberger), #90).
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boom (0.2.4)
5
- yajl-ruby (~> 1.1.0)
4
+ boom (0.4.0)
5
+ yajl-ruby (~> 1.1)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
10
  mocha (0.9.12)
11
- rake (0.9.2)
12
- yajl-ruby (1.1.0)
11
+ rake (0.9.6)
12
+ yajl-ruby (1.3.0)
13
13
 
14
14
  PLATFORMS
15
15
  ruby
@@ -18,3 +18,6 @@ DEPENDENCIES
18
18
  boom!
19
19
  mocha (~> 0.9.9)
20
20
  rake (~> 0.9.2)
21
+
22
+ BUNDLED WITH
23
+ 1.12.5
data/Rakefile CHANGED
@@ -75,9 +75,9 @@ task :release => :build do
75
75
  puts "You must be on the master branch to release!"
76
76
  exit!
77
77
  end
78
- # sh "git commit --allow-empty -a -m 'Release #{version}'"
79
- # sh "git tag v#{version}"
80
- # sh "git push origin master"
78
+ sh "git commit --allow-empty -a -m 'Release #{version}'"
79
+ sh "git tag v#{version}"
80
+ sh "git push origin master"
81
81
  sh "git push origin v#{version}"
82
82
  sh "gem push pkg/#{name}-#{version}.gem"
83
83
  end
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'boom'
16
- s.version = '0.4.0'
17
- s.date = '2013-08-18'
16
+ s.version = '0.5.0'
17
+ s.date = '2017-03-31'
18
18
  s.rubyforge_project = 'boom'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.authors = ["Zach Holman"]
35
35
  s.email = 'zach@zachholman.com'
36
36
  s.homepage = 'https://github.com/holman/boom'
37
+ s.license = 'MIT'
37
38
 
38
39
  ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
39
40
  ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
@@ -54,7 +55,7 @@ Gem::Specification.new do |s|
54
55
 
55
56
  ## List your runtime dependencies here. Runtime dependencies are those
56
57
  ## that are needed for an end user to actually USE your code.
57
- s.add_dependency('yajl-ruby', "~> 1.1.0")
58
+ s.add_dependency('yajl-ruby', "~> 1.1")
58
59
 
59
60
  ## List your development dependencies here. Development dependencies are
60
61
  ## those that are only needed during development
@@ -7,7 +7,7 @@ _boom_complete() {
7
7
  local IFS=$'\n'
8
8
 
9
9
  if [ $COMP_CWORD -eq 1 ]; then
10
- lists=`boom | sed 's/^ \(.*\) ([0-9]\+)$/\1/'`
10
+ lists=`boom | sed 's/^ \(.*\) ([0-9]\{1,\})$/\1/'`
11
11
  COMPREPLY=( $( compgen -W '${lists}' -- ${cur} ) )
12
12
  elif [ $COMP_CWORD -eq 2 ]; then
13
13
  items=`boom $curr_list | sed 's/^ \(.\{0,16\}\):.*$/\1/'`
@@ -20,7 +20,7 @@ require 'boom/storage'
20
20
  require 'boom/core_ext/symbol'
21
21
 
22
22
  module Boom
23
- VERSION = '0.4.0'
23
+ VERSION = '0.5.0'
24
24
 
25
25
  def self.storage
26
26
  @storage ||= Storage.new
@@ -240,13 +240,17 @@ module Boom
240
240
  #
241
241
  # Returns nothing.
242
242
  def delete_list(name)
243
- printf "You sure you want to delete everything in #{yellow(name)}? (y/n): "
244
- if $stdin.gets.chomp == 'y'
245
- List.delete(name)
246
- output "#{cyan("Boom!")} Deleted all your #{yellow(name)}."
247
- save
243
+ if storage.list_exists?(name)
244
+ printf "You sure you want to delete everything in #{yellow(name)}? (y/n): "
245
+ if $stdin.gets.chomp == 'y'
246
+ List.delete(name)
247
+ output "#{cyan("Boom!")} Deleted all your #{yellow(name)}."
248
+ save
249
+ else
250
+ output "Just kidding then."
251
+ end
248
252
  else
249
- output "Just kidding then."
253
+ output "We couldn't find that list."
250
254
  end
251
255
  end
252
256
 
@@ -10,6 +10,13 @@
10
10
  module Boom
11
11
  class Platform
12
12
  class << self
13
+ # Public: tests if currently running on cygwin.
14
+ #
15
+ # Returns true if running on Cygwin, else false
16
+ def cygwin?
17
+ !!(RbConfig::CONFIG['host_os'] =~ /cygwin/)
18
+ end
19
+
13
20
  # Public: tests if currently running on darwin.
14
21
  #
15
22
  # Returns true if running on darwin (MacOS X), else false
@@ -37,6 +44,8 @@ module Boom
37
44
  'open'
38
45
  elsif windows?
39
46
  'start'
47
+ elsif cygwin?
48
+ 'cygstart'
40
49
  else
41
50
  'xdg-open'
42
51
  end
@@ -63,7 +72,7 @@ module Boom
63
72
  def copy_command
64
73
  if darwin?
65
74
  'pbcopy'
66
- elsif windows?
75
+ elsif windows? || cygwin?
67
76
  'clip'
68
77
  else
69
78
  'xclip -selection clipboard'
@@ -65,7 +65,7 @@ module Boom
65
65
 
66
66
  # Public: creates a Hash of the representation of the in-memory data
67
67
  # structure. This percolates down to Items by calling to_hash on the List,
68
- # which in tern calls to_hash on individual Items.
68
+ # which in turn calls to_hash on individual Items.
69
69
  #
70
70
  # Returns a Hash of the entire data set.
71
71
  def to_hash
@@ -77,13 +77,13 @@ module Boom
77
77
  #
78
78
  # Return true if successfully saved.
79
79
  def bootstrap
80
- return if File.exist?(json_file)
80
+ return if File.exist?(json_file) and !File.zero?(json_file)
81
81
  FileUtils.touch json_file
82
82
  File.open(json_file, 'w') {|f| f.write(to_json) }
83
83
  save
84
84
  end
85
85
 
86
- # Take a JSON representation of data and explode it out into the consituent
86
+ # Take a JSON representation of data and explode it out into the constituent
87
87
  # Lists and Items for the given Storage instance.
88
88
  #
89
89
  # Returns nothing.
@@ -121,4 +121,4 @@ module Boom
121
121
  Yajl::Encoder.encode(to_hash, :pretty => true)
122
122
  end
123
123
  end
124
- end
124
+ end
@@ -27,4 +27,16 @@ it_deletes_a_list() {
27
27
  $boom | grep "enemies"
28
28
  yes | $boom delete enemies | grep "Deleted"
29
29
  ! $boom | grep "enemies"
30
- }
30
+ }
31
+
32
+ it_handles_delete_on_nonexistent_list() {
33
+ ! $boom | grep "enemies"
34
+ $boom delete "enemies" | grep "We couldn't find that list"
35
+ }
36
+
37
+ it_handles_empty_boomfile() {
38
+ cp /dev/null test/examples/empty.json
39
+ export BOOMFILE=test/examples/empty.json
40
+ $boom heynow | grep "Created a new list"
41
+ export BOOMFILE=test/examples/data.json
42
+ }
metadata CHANGED
@@ -1,71 +1,65 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
5
- prerelease:
4
+ version: 0.5.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Zach Holman
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-18 00:00:00.000000000 Z
11
+ date: 2017-03-31 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: yajl-ruby
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: 1.1.0
19
+ version: '1.1'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: 1.1.0
26
+ version: '1.1'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: mocha
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: 0.9.9
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: 0.9.9
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
47
  version: 0.9.2
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
54
  version: 0.9.2
62
- description: ! "God it's about every day where I think to myself, gadzooks,\n I keep
63
- typing *REPETITIVE_BORING_TASK* over and over. Wouldn't it be great if\n I had
64
- something like boom to store all these commonly-used text snippets for\n me? Then
65
- I realized that was a worthless idea since boom hadn't been created\n yet and I
66
- had no idea what that statement meant. At some point I found the\n code for boom
67
- in a dark alleyway and released it under my own name because I\n wanted to look
68
- smart."
55
+ description: |-
56
+ God it's about every day where I think to myself, gadzooks,
57
+ I keep typing *REPETITIVE_BORING_TASK* over and over. Wouldn't it be great if
58
+ I had something like boom to store all these commonly-used text snippets for
59
+ me? Then I realized that was a worthless idea since boom hadn't been created
60
+ yet and I had no idea what that statement meant. At some point I found the
61
+ code for boom in a dark alleyway and released it under my own name because I
62
+ wanted to look smart.
69
63
  email: zach@zachholman.com
70
64
  executables:
71
65
  - boom
@@ -100,27 +94,27 @@ files:
100
94
  - test/roundup
101
95
  - test/run
102
96
  homepage: https://github.com/holman/boom
103
- licenses: []
97
+ licenses:
98
+ - MIT
99
+ metadata: {}
104
100
  post_install_message:
105
101
  rdoc_options:
106
- - --charset=UTF-8
102
+ - "--charset=UTF-8"
107
103
  require_paths:
108
104
  - lib
109
105
  required_ruby_version: !ruby/object:Gem::Requirement
110
- none: false
111
106
  requirements:
112
- - - ! '>='
107
+ - - ">="
113
108
  - !ruby/object:Gem::Version
114
109
  version: '0'
115
110
  required_rubygems_version: !ruby/object:Gem::Requirement
116
- none: false
117
111
  requirements:
118
- - - ! '>='
112
+ - - ">="
119
113
  - !ruby/object:Gem::Version
120
114
  version: '0'
121
115
  requirements: []
122
116
  rubyforge_project: boom
123
- rubygems_version: 1.8.23
117
+ rubygems_version: 2.5.1
124
118
  signing_key:
125
119
  specification_version: 2
126
120
  summary: boom lets you access text snippets over your command line.