micktagger 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ script: bundle exec rspec spec
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # MickTagger
2
+ [![Build Status](https://secure.travis-ci.org/mrnugget/micktagger.png)](http://travis-ci.org/mrnugget/micktagger)
2
3
 
3
4
  MickTagger is a command line utility that allows you to tag files.
4
5
 
@@ -22,7 +22,17 @@ module MickTagger
22
22
  params[:tag] = tag
23
23
  end
24
24
 
25
+ parser.on('-h', '--help [TAG]', String) do |tag|
26
+ puts parser
27
+ exit
28
+ end
29
+
25
30
  files = parser.parse!
31
+
32
+ if files.empty? && params[:action] != :list
33
+ $stdin.each_line.each { |line| files << line.strip }
34
+ end
35
+
26
36
  files.map! {|file| File.expand_path(file) }
27
37
 
28
38
  case params[:action]
@@ -1,3 +1,3 @@
1
1
  module MickTagger
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -0,0 +1 @@
1
+ Hey you! Have a good day :)
@@ -0,0 +1 @@
1
+ # Nice to see you :)
@@ -28,4 +28,15 @@ describe 'micktagger command line interface' do
28
28
  dotfile = read_and_parse_fake_dotfile
29
29
  dotfile.should_not include(readme_full_path)
30
30
  end
31
+
32
+ it 'allows me to tag files piped to STDIN' do
33
+ dir = "#{ENV['HOME']}"
34
+
35
+ `cd #{dir} && ls #{dir} | mt -a important`
36
+
37
+ dotfile = read_and_parse_fake_dotfile
38
+
39
+ dotfile["#{dir}/readme.md"].should include('important')
40
+ dotfile["#{dir}/delete_after_reading.txt"].should include('important')
41
+ end
31
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micktagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,17 +36,20 @@ extensions: []
36
36
  extra_rdoc_files: []
37
37
  files:
38
38
  - .gitignore
39
+ - .travis.yml
39
40
  - Gemfile
40
41
  - Gemfile.lock
41
42
  - LICENSE
42
43
  - README.md
43
44
  - bin/mt
44
- - empty.yaml
45
45
  - lib/micktagger.rb
46
46
  - lib/micktagger/cli.rb
47
47
  - lib/micktagger/dotfile_handler.rb
48
48
  - lib/micktagger/version.rb
49
49
  - micktagger.gemspec
50
+ - spec/fixtures/fake_home/.gitkeep
51
+ - spec/fixtures/fake_home/delete_after_reading.txt
52
+ - spec/fixtures/fake_home/readme.md
50
53
  - spec/integration/mt_spec.rb
51
54
  - spec/spec_helper.rb
52
55
  - spec/support/dotfile_helpers.rb
@@ -79,6 +82,9 @@ summary: With MickTagger you can tag files, list files tagged with a specified t
79
82
  remove tags and do cool stuff — all on the command line! It only needs a small json
80
83
  dotfile in your homedirectory to save that information.
81
84
  test_files:
85
+ - spec/fixtures/fake_home/.gitkeep
86
+ - spec/fixtures/fake_home/delete_after_reading.txt
87
+ - spec/fixtures/fake_home/readme.md
82
88
  - spec/integration/mt_spec.rb
83
89
  - spec/spec_helper.rb
84
90
  - spec/support/dotfile_helpers.rb