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 +2 -2
- data/.travis.yml +2 -0
- data/CHANGELOG.rdoc +3 -0
- data/Rakefile +4 -2
- data/deps.rip +1 -1
- data/lib/tag/runner.rb +5 -0
- data/lib/tag/store.rb +10 -0
- data/lib/tag/version.rb +1 -1
- data/spec/deps.rip +1 -1
- data/spec/helper.rb +3 -1
- data/spec/runner_spec.rb +7 -0
- metadata +12 -12
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.
|
16
|
-
s.add_development_dependency 'bahia', '~> 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}
|
data/.travis.yml
CHANGED
data/CHANGELOG.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -29,8 +29,10 @@ end
|
|
29
29
|
|
30
30
|
desc 'Run tests'
|
31
31
|
task :test do |t|
|
32
|
-
|
33
|
-
sh '
|
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.
|
1
|
+
boson ~>1.2
|
data/lib/tag/runner.rb
CHANGED
data/lib/tag/store.rb
CHANGED
@@ -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
|
data/lib/tag/version.rb
CHANGED
data/spec/deps.rip
CHANGED
data/spec/helper.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
gem 'minitest' unless ENV['NO_RUBYGEMS']
|
2
|
-
require 'minitest/
|
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
|
data/spec/runner_spec.rb
CHANGED
@@ -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.
|
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-
|
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: &
|
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.
|
21
|
+
version: '1.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70199458524160
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bahia
|
27
|
-
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.
|
32
|
+
version: '0.7'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70199458523560
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: minitest
|
38
|
-
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: *
|
46
|
+
version_requirements: *70199458539220
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
|
-
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: *
|
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
|