stickyflag 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/TODO.md +2 -1
  2. data/lib/stickyflag/version.rb +1 -1
  3. data/stickyflag.gemspec +5 -4
  4. metadata +8 -116
  5. data/.gitignore +0 -7
  6. data/.rspec +0 -4
  7. data/.simplecov +0 -9
  8. data/.travis.yml +0 -13
  9. data/features/clear.feature +0 -14
  10. data/features/clear_quietly.feature +0 -23
  11. data/features/configuration.feature +0 -14
  12. data/features/get.feature +0 -14
  13. data/features/get_quietly.feature +0 -23
  14. data/features/set.feature +0 -14
  15. data/features/set_quietly.feature +0 -22
  16. data/features/step_definitions/configuration_steps.rb +0 -31
  17. data/features/step_definitions/database_steps.rb +0 -41
  18. data/features/step_definitions/pending_steps.rb +0 -5
  19. data/features/step_definitions/tag_steps.rb +0 -62
  20. data/features/support/cukegem.rb +0 -82
  21. data/features/support/env.rb +0 -37
  22. data/features/tags.feature +0 -18
  23. data/features/unset.feature +0 -14
  24. data/features/unset_quietly.feature +0 -23
  25. data/spec/spec_helper.rb +0 -22
  26. data/spec/stickyflag/configuration_spec.rb +0 -132
  27. data/spec/stickyflag/database_spec.rb +0 -331
  28. data/spec/stickyflag/external_cmds_spec.rb +0 -175
  29. data/spec/stickyflag/patches/tempfile_encoding_spec.rb +0 -26
  30. data/spec/stickyflag/patches/tmpnam_spec.rb +0 -35
  31. data/spec/stickyflag/paths_spec.rb +0 -29
  32. data/spec/stickyflag/tag_factory_spec.rb +0 -126
  33. data/spec/stickyflag/tags/c_spec.rb +0 -14
  34. data/spec/stickyflag/tags/mkv_spec.rb +0 -54
  35. data/spec/stickyflag/tags/mmd_spec.rb +0 -40
  36. data/spec/stickyflag/tags/pdf_spec.rb +0 -39
  37. data/spec/stickyflag/tags/png_spec.rb +0 -6
  38. data/spec/stickyflag/tags/tex_spec.rb +0 -6
  39. data/spec/stickyflag_spec.rb +0 -482
  40. data/spec/support/examples.rb +0 -32
  41. data/spec/support/examples/c_all_comments.c +0 -3
  42. data/spec/support/examples/c_no_tags.c +0 -5
  43. data/spec/support/examples/c_with_tag.c +0 -6
  44. data/spec/support/examples/mkv_no_tags.mkv +0 -0
  45. data/spec/support/examples/mkv_with_tag.mkv +0 -0
  46. data/spec/support/examples/mmd_all_meta.mmd +0 -6
  47. data/spec/support/examples/mmd_crazy_keys.mmd +0 -8
  48. data/spec/support/examples/mmd_crazy_tags.mmd +0 -9
  49. data/spec/support/examples/mmd_no_tags.mmd +0 -1
  50. data/spec/support/examples/mmd_with_tag.mmd +0 -3
  51. data/spec/support/examples/pdf_no_tags.pdf +0 -0
  52. data/spec/support/examples/pdf_with_tag.pdf +0 -0
  53. data/spec/support/examples/png_no_tags.png +0 -0
  54. data/spec/support/examples/png_with_tag.png +0 -0
  55. data/spec/support/examples/tex_no_tags.tex +0 -10
  56. data/spec/support/examples/tex_with_tag.tex +0 -11
  57. data/spec/support/examples/untaggable.txt +0 -0
  58. data/spec/support/run_with_args.rb +0 -36
  59. data/spec/support/silence_stream.rb +0 -12
  60. data/spec/support/tag_handler_behavior.rb +0 -125
data/TODO.md CHANGED
@@ -1,3 +1,4 @@
1
1
  # TODO
2
2
 
3
- - Add tag handlers: JPEG, MMD
3
+ - Add tag handlers: JPEG
4
+ - Fix the exit codes for --quiet
@@ -5,7 +5,7 @@ module StickyFlag
5
5
  NUMBERS = [
6
6
  MAJOR = 0,
7
7
  MINOR = 3,
8
- BUILD = 0
8
+ BUILD = 1
9
9
  ]
10
10
  end
11
11
  VERSION = Version::NUMBERS.join('.')
@@ -39,11 +39,12 @@ Gem::Specification.new do |s|
39
39
  s.add_development_dependency 'simplecov'
40
40
  s.add_development_dependency 'magic_encoding'
41
41
 
42
- s.files = `git ls-files`.split("\n")
43
- s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f)}
42
+ s.files = `git ls-files -- bin/* lib/*`.split("\n")
43
+ s.files |= ['Gemfile', 'stickyflag.gemspec', 'Rakefile', 'LICENSE.md', 'README.md', 'TODO.md']
44
+
45
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
44
46
  s.default_executable = 'bin/stickyflag'
45
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
46
47
 
47
- s.extra_rdoc_files = ['LICENSE.md', 'README.md', 'Rakefile', 'TODO.md']
48
+ s.extra_rdoc_files = ['Rakefile', 'LICENSE.md', 'README.md', 'TODO.md']
48
49
  s.rdoc_options = ['--charset=UTF-8']
49
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stickyflag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -258,37 +258,12 @@ executables:
258
258
  - stickyflag
259
259
  extensions: []
260
260
  extra_rdoc_files:
261
- - LICENSE.md
262
- - README.md
263
261
  - Rakefile
264
- - TODO.md
265
- files:
266
- - .gitignore
267
- - .rspec
268
- - .simplecov
269
- - .travis.yml
270
- - Gemfile
271
262
  - LICENSE.md
272
263
  - README.md
273
- - Rakefile
274
264
  - TODO.md
265
+ files:
275
266
  - bin/stickyflag
276
- - features/clear.feature
277
- - features/clear_quietly.feature
278
- - features/configuration.feature
279
- - features/get.feature
280
- - features/get_quietly.feature
281
- - features/set.feature
282
- - features/set_quietly.feature
283
- - features/step_definitions/configuration_steps.rb
284
- - features/step_definitions/database_steps.rb
285
- - features/step_definitions/pending_steps.rb
286
- - features/step_definitions/tag_steps.rb
287
- - features/support/cukegem.rb
288
- - features/support/env.rb
289
- - features/tags.feature
290
- - features/unset.feature
291
- - features/unset_quietly.feature
292
267
  - lib/stickyflag.rb
293
268
  - lib/stickyflag/configuration.rb
294
269
  - lib/stickyflag/database.rb
@@ -305,43 +280,12 @@ files:
305
280
  - lib/stickyflag/tags/source_code.rb
306
281
  - lib/stickyflag/tags/tex.rb
307
282
  - lib/stickyflag/version.rb
308
- - spec/spec_helper.rb
309
- - spec/stickyflag/configuration_spec.rb
310
- - spec/stickyflag/database_spec.rb
311
- - spec/stickyflag/external_cmds_spec.rb
312
- - spec/stickyflag/patches/tempfile_encoding_spec.rb
313
- - spec/stickyflag/patches/tmpnam_spec.rb
314
- - spec/stickyflag/paths_spec.rb
315
- - spec/stickyflag/tag_factory_spec.rb
316
- - spec/stickyflag/tags/c_spec.rb
317
- - spec/stickyflag/tags/mkv_spec.rb
318
- - spec/stickyflag/tags/mmd_spec.rb
319
- - spec/stickyflag/tags/pdf_spec.rb
320
- - spec/stickyflag/tags/png_spec.rb
321
- - spec/stickyflag/tags/tex_spec.rb
322
- - spec/stickyflag_spec.rb
323
- - spec/support/examples.rb
324
- - spec/support/examples/c_all_comments.c
325
- - spec/support/examples/c_no_tags.c
326
- - spec/support/examples/c_with_tag.c
327
- - spec/support/examples/mkv_no_tags.mkv
328
- - spec/support/examples/mkv_with_tag.mkv
329
- - spec/support/examples/mmd_all_meta.mmd
330
- - spec/support/examples/mmd_crazy_keys.mmd
331
- - spec/support/examples/mmd_crazy_tags.mmd
332
- - spec/support/examples/mmd_no_tags.mmd
333
- - spec/support/examples/mmd_with_tag.mmd
334
- - spec/support/examples/pdf_no_tags.pdf
335
- - spec/support/examples/pdf_with_tag.pdf
336
- - spec/support/examples/png_no_tags.png
337
- - spec/support/examples/png_with_tag.png
338
- - spec/support/examples/tex_no_tags.tex
339
- - spec/support/examples/tex_with_tag.tex
340
- - spec/support/examples/untaggable.txt
341
- - spec/support/run_with_args.rb
342
- - spec/support/silence_stream.rb
343
- - spec/support/tag_handler_behavior.rb
283
+ - Gemfile
344
284
  - stickyflag.gemspec
285
+ - Rakefile
286
+ - LICENSE.md
287
+ - README.md
288
+ - TODO.md
345
289
  homepage: https://github.com/cpence/stickyflag
346
290
  licenses: []
347
291
  post_install_message:
@@ -367,56 +311,4 @@ rubygems_version: 1.8.23
367
311
  signing_key:
368
312
  specification_version: 3
369
313
  summary: Tag your files, search by tags
370
- test_files:
371
- - features/clear.feature
372
- - features/clear_quietly.feature
373
- - features/configuration.feature
374
- - features/get.feature
375
- - features/get_quietly.feature
376
- - features/set.feature
377
- - features/set_quietly.feature
378
- - features/step_definitions/configuration_steps.rb
379
- - features/step_definitions/database_steps.rb
380
- - features/step_definitions/pending_steps.rb
381
- - features/step_definitions/tag_steps.rb
382
- - features/support/cukegem.rb
383
- - features/support/env.rb
384
- - features/tags.feature
385
- - features/unset.feature
386
- - features/unset_quietly.feature
387
- - spec/spec_helper.rb
388
- - spec/stickyflag/configuration_spec.rb
389
- - spec/stickyflag/database_spec.rb
390
- - spec/stickyflag/external_cmds_spec.rb
391
- - spec/stickyflag/patches/tempfile_encoding_spec.rb
392
- - spec/stickyflag/patches/tmpnam_spec.rb
393
- - spec/stickyflag/paths_spec.rb
394
- - spec/stickyflag/tag_factory_spec.rb
395
- - spec/stickyflag/tags/c_spec.rb
396
- - spec/stickyflag/tags/mkv_spec.rb
397
- - spec/stickyflag/tags/mmd_spec.rb
398
- - spec/stickyflag/tags/pdf_spec.rb
399
- - spec/stickyflag/tags/png_spec.rb
400
- - spec/stickyflag/tags/tex_spec.rb
401
- - spec/stickyflag_spec.rb
402
- - spec/support/examples.rb
403
- - spec/support/examples/c_all_comments.c
404
- - spec/support/examples/c_no_tags.c
405
- - spec/support/examples/c_with_tag.c
406
- - spec/support/examples/mkv_no_tags.mkv
407
- - spec/support/examples/mkv_with_tag.mkv
408
- - spec/support/examples/mmd_all_meta.mmd
409
- - spec/support/examples/mmd_crazy_keys.mmd
410
- - spec/support/examples/mmd_crazy_tags.mmd
411
- - spec/support/examples/mmd_no_tags.mmd
412
- - spec/support/examples/mmd_with_tag.mmd
413
- - spec/support/examples/pdf_no_tags.pdf
414
- - spec/support/examples/pdf_with_tag.pdf
415
- - spec/support/examples/png_no_tags.png
416
- - spec/support/examples/png_with_tag.png
417
- - spec/support/examples/tex_no_tags.tex
418
- - spec/support/examples/tex_with_tag.tex
419
- - spec/support/examples/untaggable.txt
420
- - spec/support/run_with_args.rb
421
- - spec/support/silence_stream.rb
422
- - spec/support/tag_handler_behavior.rb
314
+ test_files: []
data/.gitignore DELETED
@@ -1,7 +0,0 @@
1
- Gemfile.lock
2
-
3
- pkg
4
- spec/coverage
5
- tmp
6
-
7
- *.gem
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --require thor
2
- --require spec_helper
3
- --colour
4
- --order random
data/.simplecov DELETED
@@ -1,9 +0,0 @@
1
- SimpleCov.start do
2
- coverage_dir '/spec/coverage'
3
- add_filter '/spec/'
4
-
5
- add_group 'Frontend', 'bin'
6
- add_group 'Library code', 'lib'
7
- add_group 'File taggers', 'lib/tags'
8
- add_group 'Core patches', 'lib/patches'
9
- end
@@ -1,13 +0,0 @@
1
- language: ruby
2
- before_install:
3
- - sudo apt-get update -qq
4
- - sudo apt-get install -qq pdftk mkvtoolnix
5
- script: "bundle exec rake"
6
-
7
- env:
8
- - CI=true
9
- rvm:
10
- - 1.9.3
11
- - 1.8.7
12
- - ree
13
- - jruby-19mode
@@ -1,14 +0,0 @@
1
- Feature: Clear File Tags
2
- In order to reset the tags on a file
3
- As a user with some tagged files
4
- I want to be able to clear all the file's tags
5
-
6
- Scenario: Clear tags from a tagged file
7
- Given the example configuration
8
- When I clear the tags for "mmd_crazy_tags.mmd"
9
- Then the output should match /Tags cleared for .*mmd_crazy_tags\.mmd/
10
-
11
- Scenario: Clear tags from an untagged file
12
- Given the example configuration
13
- When I clear the tags for "mmd_no_tags.mmd"
14
- Then the output should match /Tags cleared for .*mmd_no_tags\.mmd/
@@ -1,23 +0,0 @@
1
- Feature: Silence Extraneous Output on Clear
2
- In order to use StickyFlag in scripts
3
- As a power user
4
- I want to be able to clear tags without any output at all
5
-
6
- Scenario: Clear tags without worrying about missing tags or files
7
- Given the example configuration
8
- When I quietly clear the tags for "mmd_crazy_tags.mmd", "mmd_no_tags.mmd", and "nonexistent.mmd"
9
- Then the output should not contain "mmd_crazy_tags.mmd"
10
- And the output should not contain "mmd_no_tags.mmd"
11
- And the output should not contain "nonexistent.mmd"
12
-
13
- Scenario: Determine quiet tag clear success from return value
14
- Given the example configuration
15
- Given PENDING: figure out how to get Thor to do exit codes
16
- When I quietly clear the tags for "mmd_crazy_tags.mmd"
17
- Then the exit status should be 0
18
-
19
- Scenario: Determine quiet tag clear failure from return value
20
- Given the example configuration
21
- Given PENDING: figure out how to get Thor to do exit codes
22
- When I quietly clear the tags for "nonexistent.mmd"
23
- Then the exit status should not be 0
@@ -1,14 +0,0 @@
1
- Feature: Persistent Configuration
2
- In order to customize the behavior of StickyFlag
3
- As a new user
4
- I want to be able to set persistent configuration values
5
-
6
- Scenario: Set and query a configuration value
7
- Given a clean configuration
8
- When I set the configuration key "root" to "/test/"
9
- And I get the configuration key "root"
10
- Then the output should contain "root: '/test/'"
11
-
12
- Scenario: Query a previously set configuration value
13
- When I get the configuration key "root"
14
- Then the output should contain "root: '/test/'"
@@ -1,14 +0,0 @@
1
- Feature: Get File Tags
2
- In order to know what tags I have set on a file
3
- As a user with some tagged files
4
- I want to be able to query the file tags
5
-
6
- Scenario: Get tags from a tagged file
7
- Given the example configuration
8
- When I get the tags for "mmd_crazy_tags.mmd"
9
- Then the output should contain "mmd_crazy_tags.mmd: asdf, sdfg, dfgh, fghj, qwer"
10
-
11
- Scenario: Get tags from an untagged file
12
- Given the example configuration
13
- When I get the tags for "mmd_no_tags.mmd"
14
- Then the output should contain "mmd_no_tags.mmd: no tags"
@@ -1,23 +0,0 @@
1
- Feature: Silence Extraneous Output on Get
2
- In order to use StickyFlag in scripts
3
- As a power user
4
- I want to be able to get tags without extra output
5
-
6
- Scenario: Get tags without worrying about missing tags or files
7
- Given the example configuration
8
- When I quietly get the tags for "mmd_crazy_tags.mmd", "mmd_no_tags.mmd", and "nonexistent.mmd"
9
- Then the output should contain "mmd_crazy_tags.mmd: asdf, sdfg, dfgh, fghj, qwer"
10
- And the output should not contain "mmd_no_tags.mmd"
11
- And the output should not contain "nonexistent.mmd"
12
-
13
- Scenario: Determine quiet tag get success from return value
14
- Given the example configuration
15
- Given PENDING: figure out how to get Thor to do exit codes
16
- When I quietly get the tags for "mmd_crazy_tags.mmd"
17
- Then the exit status should be 0
18
-
19
- Scenario: Determine quiet tag get failure from return value
20
- Given the example configuration
21
- Given PENDING: figure out how to get Thor to do exit codes
22
- When I quietly get the tags for "nonexistent.mmd"
23
- Then the exit status should not be 0
@@ -1,14 +0,0 @@
1
- Feature: Set File Tags
2
- In order to keep track of my files
3
- As a user
4
- I want to be able to set new tags on files
5
-
6
- Scenario: Set tags on an already tagged file
7
- Given the example configuration
8
- When I set the tag "test2" for "mmd_crazy_tags.mmd"
9
- Then the output should match /New tags for .*mmd_crazy_tags.mmd: asdf, sdfg, dfgh, fghj, qwer, test2/
10
-
11
- Scenario: Set tags on an untagged file
12
- Given the example configuration
13
- When I set the tag "test" for "mmd_no_tags.mmd"
14
- Then the output should match /New tags for .*mmd_no_tags.mmd: test/
@@ -1,22 +0,0 @@
1
- Feature: Silence Extraneous Output on Set
2
- In order to use StickyFlag in scripts
3
- As a power user
4
- I want to be able to set tags without any output at all
5
-
6
- Scenario: Set tags with no output at all
7
- Given the example configuration
8
- When I quietly set the tag "test2" for "mmd_crazy_tags.mmd"
9
- Then the output should not contain "mmd_crazy_tags.mmd"
10
- And the output should not contain "test2"
11
-
12
- Scenario: Determine quiet set tag success from return value
13
- Given the example configuration
14
- Given PENDING: figure out how to get Thor to do exit codes
15
- When I quietly set the tag "test2" for "mmd_crazy_tags.mmd"
16
- Then the exit status should be 0
17
-
18
- Scenario: Determine quiet set tag failure from return value
19
- Given the example configuration
20
- Given PENDING: figure out how to get Thor to do exit codes
21
- When I quietly set the tag "test" for "nonexistent.mmd"
22
- Then the exit status should not be 0
@@ -1,31 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'rspec/expectations'
3
- require 'cucumber/formatter/unicode'
4
- require 'aruba/cucumber'
5
- require_relative '../../spec/support/examples'
6
-
7
- Given /a clean configuration/ do
8
- FileUtils.rm $paths.config_path if File.exist? $paths.config_path
9
- end
10
-
11
- Given /the example configuration/ do
12
- path = example_root
13
-
14
- steps %Q{
15
- Given a clean configuration
16
- When I run `stickyflag config -k root '#{path}'`
17
- And I run `stickyflag update`
18
- }
19
- end
20
-
21
- When /I set the configuration key "(.*?)" to "(.*?)"$/ do |key, val|
22
- steps %Q{
23
- When I run `stickyflag config -k '#{key}' '#{val}'`
24
- }
25
- end
26
-
27
- When /I get the configuration key "(.*?)"$/ do |key|
28
- steps %Q{
29
- When I run `stickyflag config -k '#{key}'`
30
- }
31
- end
@@ -1,41 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'rspec/expectations'
3
- require 'cucumber/formatter/unicode'
4
- require 'aruba/cucumber'
5
-
6
- Given /a clean database/ do
7
- FileUtils.rm $paths.database_path if File.exist? $paths.database_path
8
- end
9
-
10
- Given /the example database/ do
11
- steps %Q{
12
- Given the example configuration
13
- When I run `stickyflag update`
14
- }
15
- end
16
-
17
- Given /I update the database in the directory "(.*?)"$/ do |dir|
18
- steps %Q{
19
- When I set the configuration key "root" to "#{dir}"
20
- When I run `stickyflag update`
21
- }
22
- end
23
-
24
- When /I get the list of tags in use/ do
25
- steps %Q{
26
- When I run `stickyflag tags`
27
- }
28
- end
29
-
30
- When /I quietly get the list of tags in use/ do
31
- steps %Q{
32
- When I run `stickyflag tags --quiet`
33
- }
34
- end
35
-
36
- When /I search for the tag (".*?")$/ do |tag_strings|
37
- tags = tag_strings.scan(/"([^"]+?)"/).flatten
38
- steps %Q{
39
- When I run `stickyflag find #{tags.join(' ')}`
40
- }
41
- end
@@ -1,5 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- Given /^PENDING/ do
4
- pending
5
- end
@@ -1,62 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'rspec/expectations'
3
- require 'cucumber/formatter/unicode'
4
- require 'aruba/cucumber'
5
- require 'backports'
6
- require_relative '../../spec/support/examples'
7
-
8
- When /I get the tags for (".*?")$/ do |filename_strings|
9
- filenames = filename_strings.scan(/"([^"]+?)"/).flatten.map { |f| "'#{example_path(f).to_s}'" }
10
- steps %Q{
11
- When I run `stickyflag get #{filenames.join(' ')}`
12
- }
13
- end
14
-
15
- When /I quietly get the tags for (".*?")$/ do |filename_strings|
16
- filenames = filename_strings.scan(/"([^"]+?)"/).flatten.map { |f| "'#{example_path(f).to_s}'" }
17
- steps %Q{
18
- When I run `stickyflag get #{filenames.join(' ')} --quiet`
19
- }
20
- end
21
-
22
- When /I set the tag "(.*?)" for "(.*?)"$/ do |tag, filename|
23
- path = copy_example(filename)
24
- steps %Q{
25
- When I run `stickyflag set '#{path}' '#{tag}'`
26
- }
27
- end
28
-
29
- When /I quietly set the tag "(.*?)" for "(.*?)"$/ do |tag, filename|
30
- path = copy_example(filename)
31
- steps %Q{
32
- When I run `stickyflag set '#{path}' '#{tag}' --quiet`
33
- }
34
- end
35
-
36
- When /I unset the tag "(.*?)" for "(.*?)"$/ do |tag, filename|
37
- path = copy_example(filename)
38
- steps %Q{
39
- When I run `stickyflag unset '#{path}' '#{tag}'`
40
- }
41
- end
42
-
43
- When /I quietly unset the tag "(.*?)" for "(.*?)"$/ do |tag, filename|
44
- path = copy_example(filename)
45
- steps %Q{
46
- When I run `stickyflag unset '#{path}' '#{tag}' --quiet`
47
- }
48
- end
49
-
50
- When /I clear the tags for (".*?")$/ do |filename_strings|
51
- filenames = filename_strings.scan(/"([^"]+?)"/).flatten.map { |f| "'#{copy_example(f).to_s}'" }
52
- steps %Q{
53
- When I run `stickyflag clear #{filenames.join(' ')}`
54
- }
55
- end
56
-
57
- When /I quietly clear the tags for (".*?")$/ do |filename_strings|
58
- filenames = filename_strings.scan(/"([^"]+?)"/).flatten.map { |f| "'#{copy_example(f).to_s}'" }
59
- steps %Q{
60
- When I run `stickyflag clear #{filenames.join(' ')} --quiet`
61
- }
62
- end