tag 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gemspec CHANGED
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
  s.description = "This project lets you tag anything from the commandline. The `tag` executable provides a consistent way to add, remove and modify tags for tagged items. The goal is to make tagging dead simple and usable by other commandline apps. In making tags a first class nix citizen, perhaps they will see the light of day."
13
13
  s.required_rubygems_version = ">= 1.3.6"
14
14
  s.executables = %w(tag)
15
- s.add_dependency 'boson', '~> 1.0.0'
16
- s.add_development_dependency 'bahia', '~> 0.4.0'
15
+ s.add_dependency 'boson', '~> 1.2'
16
+ s.add_development_dependency 'bahia', '~> 0.7'
17
17
  s.add_development_dependency 'minitest', '~> 2.11.0'
18
18
  s.add_development_dependency 'rake', '~> 0.9.2'
19
19
  s.files = Dir.glob(%w[{lib,spec}/**/*.rb bin/* [A-Z]*.{txt,rdoc,md} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec .travis.yml}
@@ -2,3 +2,5 @@ before_install: bundle init --gemspec=.gemspec
2
2
  rvm:
3
3
  - 1.9.2
4
4
  - 1.9.3
5
+ - rbx-19mode
6
+ - jruby-19mode
@@ -1,3 +1,6 @@
1
+ == 0.4.0
2
+ * Add items command
3
+
1
4
  == 0.3.0
2
5
  * Switch out thor for boson
3
6
 
data/Rakefile CHANGED
@@ -29,8 +29,10 @@ end
29
29
 
30
30
  desc 'Run tests'
31
31
  task :test do |t|
32
- ENV['RUBYLIB'] = ['lib', ENV['RUBYLIB']].compact.join(':')
33
- sh 'testrb spec/*_spec.rb'
32
+ # workaround jruby 1.6.7 bug
33
+ sh 'bundle exec ruby -Ilib spec/runner_spec.rb'
34
+ # ENV['RUBYLIB'] = ['lib', ENV['RUBYLIB']].compact.join(':')
35
+ # sh 'testrb spec/*_spec.rb'
34
36
  end
35
37
 
36
38
  task :default => :test
data/deps.rip CHANGED
@@ -1 +1 @@
1
- boson ~>1.0.0
1
+ boson ~>1.2
@@ -50,5 +50,10 @@ module Tag
50
50
  def models
51
51
  puts Tag::Store.models
52
52
  end
53
+
54
+ desc 'list all items with their tags'
55
+ def items
56
+ puts Tag.store.items
57
+ end
53
58
  end
54
59
  end
@@ -64,5 +64,15 @@ module Tag
64
64
  tags.each {|tag| @hash.delete(tag) }
65
65
  save
66
66
  end
67
+
68
+ def items
69
+ @hash.each_with_object({}) do |(tag,items),acc|
70
+ items.each do |item|
71
+ (acc[item] ||= []) << tag
72
+ end
73
+ end.sort_by {|e| e[0] }.map do |k,v|
74
+ "#{k}\t#{v.uniq.join(', ')}"
75
+ end
76
+ end
67
77
  end
68
78
  end
@@ -1,3 +1,3 @@
1
1
  module Tag
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -1,3 +1,3 @@
1
- bahia ~>0.4.0
1
+ bahia ~>0.7
2
2
  minitest ~>2.11.0
3
3
  rake ~>0.9.2
@@ -1,10 +1,12 @@
1
1
  gem 'minitest' unless ENV['NO_RUBYGEMS']
2
- require 'minitest/autorun'
2
+ require 'minitest/spec'
3
+ require 'minitest/autorun' unless $0.end_with?('/m')
3
4
  require 'tag'
4
5
  require 'fileutils'
5
6
  require 'bahia'
6
7
 
7
8
  ENV['TAG_HOME'] = File.dirname(__FILE__) + '/.tag'
9
+ ENV.delete('TAG_MODEL') # in case it's set
8
10
 
9
11
  class MiniTest::Unit::TestCase
10
12
  include Bahia
@@ -119,4 +119,11 @@ describe Tag::Runner do
119
119
  tag 'models'
120
120
  stdout.split("\n").must_equal ['default', 'physicist']
121
121
  end
122
+
123
+ it "items prints items with tags" do
124
+ tag 'add feynman -t funny'
125
+ tag 'add einstein -t bighead,postal'
126
+ tag 'items'
127
+ stdout.split("\n").must_equal ["einstein\tbighead, postal", "feynman\tfunny"]
128
+ end
122
129
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,33 +9,33 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-07 00:00:00.000000000 Z
12
+ date: 2012-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: boson
16
- requirement: &70210577708060 !ruby/object:Gem::Requirement
16
+ requirement: &70199458524160 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.0.0
21
+ version: '1.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70210577708060
24
+ version_requirements: *70199458524160
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bahia
27
- requirement: &70210577707580 !ruby/object:Gem::Requirement
27
+ requirement: &70199458523560 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: 0.4.0
32
+ version: '0.7'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70210577707580
35
+ version_requirements: *70199458523560
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: minitest
38
- requirement: &70210577707000 !ruby/object:Gem::Requirement
38
+ requirement: &70199458539220 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.11.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70210577707000
46
+ version_requirements: *70199458539220
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &70210577706480 !ruby/object:Gem::Requirement
49
+ requirement: &70199458538540 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 0.9.2
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70210577706480
57
+ version_requirements: *70199458538540
58
58
  description: This project lets you tag anything from the commandline. The `tag` executable
59
59
  provides a consistent way to add, remove and modify tags for tagged items. The goal
60
60
  is to make tagging dead simple and usable by other commandline apps. In making tags