forgitter 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d44216e88b2115622aee6a44f918ee7df6f71c7
4
- data.tar.gz: eeeca1a668d6ca1750ba9ca0ee3cc8c7fa0d11ba
3
+ metadata.gz: 9944c607aa9d114563a1a6ea8b5a69675c1e4371
4
+ data.tar.gz: 344b690701befbecbb7ab2b34fb5bc8288a00015
5
5
  SHA512:
6
- metadata.gz: a363100e6e7a990e22a345675d8cb7686fc35f7be3bb1ce25dd1c8109993057b5d60252064e0aa5ee0c9a5749bbea1d287b93722320807a9131f87b87f85d935
7
- data.tar.gz: 0e0e10e8ba8404a24fb2f6eabdb92d8ae54d67ae7e6dd1aae5c4586f133be3cd32f2f66372a3f65e0b2d0ffb8a426ef22e4963bb3c1b2a174c82061637c0784f
6
+ metadata.gz: 0326aa319d64c310e4b331c7787026a947af60fd56d60989ebae4dc3e8c1eb6129cfd8dc618a618a9333400ea065469079bcfb5147e888e013bd07f0caf0ee47
7
+ data.tar.gz: 5502ded677083a616841a5ff4f6969401b9a17020f7c2a5725108f52aab15aff4409a08f59b2fecf07dc4a7fd132a7c3c8845a5da09945d93e1a2d176805a113
data/README.md CHANGED
@@ -39,6 +39,9 @@ submodule. After cloning this repository, run the following to retrieve the
39
39
 
40
40
  git submodule init && git submodule update
41
41
 
42
+ \*.gitignore files placed directly under `data/` will be ignored due to tag
43
+ ambiguity.
44
+
42
45
  1. Fork it ( http://github.com/cloudspace/forgitter/fork )
43
46
  2. Create your feature branch (`git checkout -b my-new-feature`)
44
47
  3. Commit your changes (`git commit -am 'Add some feature'`)
data/bin/forgitter CHANGED
@@ -6,12 +6,17 @@ require 'forgitter/cli'
6
6
  option_parser = Forgitter::CLI::OptionParser.new
7
7
  options = option_parser.parse(ARGV)
8
8
 
9
- options[:tags] = []
10
9
  options[:tags] << ARGV.pop until ARGV.empty?
11
- if options[:tags].empty?
10
+ if options[:tags].empty? && !options[:list]
12
11
  puts option_parser.help
13
12
  exit(1)
14
13
  end
14
+ options[:tags].reverse!
15
+
16
+ if options[:list]
17
+ Forgitter.list_types(options[:tags])
18
+ exit
19
+ end
15
20
 
16
21
  runner = Forgitter::Runner.new(options)
17
22
  runner.run
@@ -0,0 +1,26 @@
1
+ # Built application files
2
+ *.apk
3
+ *.ap_
4
+
5
+ # Files for the Dalvik VM
6
+ *.dex
7
+
8
+ # Java class files
9
+ *.class
10
+
11
+ # Generated files
12
+ bin/
13
+ gen/
14
+
15
+ # Gradle files
16
+ .gradle/
17
+ build/
18
+
19
+ # Local configuration file (sdk path, etc)
20
+ local.properties
21
+
22
+ # Proguard folder generated by Eclipse
23
+ proguard/
24
+
25
+ #Log Files
26
+ *.log
@@ -0,0 +1,30 @@
1
+ *.pydevproject
2
+ .metadata
3
+ .gradle
4
+ bin/
5
+ tmp/
6
+ *.tmp
7
+ *.bak
8
+ *.swp
9
+ *~.nib
10
+ local.properties
11
+ .settings/
12
+ .loadpath
13
+
14
+ # External tool builders
15
+ .externalToolBuilders/
16
+
17
+ # Locally stored "Eclipse launch configurations"
18
+ *.launch
19
+
20
+ # CDT-specific
21
+ .cproject
22
+
23
+ # PDT-specific
24
+ .buildpath
25
+
26
+ # sbteclipse plugin
27
+ .target
28
+
29
+ # TeXlipse plugin
30
+ .texlipse
@@ -0,0 +1,20 @@
1
+ .DS_Store
2
+ .AppleDouble
3
+ .LSOverride
4
+
5
+ # Icon must end with two \r
6
+ Icon
7
+
8
+ # Thumbnails
9
+ ._*
10
+
11
+ # Files that might appear on external disk
12
+ .Spotlight-V100
13
+ .Trashes
14
+
15
+ # Directories potentially created on remote AFP share
16
+ .AppleDB
17
+ .AppleDesktop
18
+ Network Trash Folder
19
+ Temporary Items
20
+ .apdisk
@@ -0,0 +1,20 @@
1
+ .DS_Store
2
+ .AppleDouble
3
+ .LSOverride
4
+
5
+ # Icon must end with two \r
6
+ Icon
7
+
8
+ # Thumbnails
9
+ ._*
10
+
11
+ # Files that might appear on external disk
12
+ .Spotlight-V100
13
+ .Trashes
14
+
15
+ # Directories potentially created on remote AFP share
16
+ .AppleDB
17
+ .AppleDesktop
18
+ Network Trash Folder
19
+ Temporary Items
20
+ .apdisk
@@ -0,0 +1,26 @@
1
+ # Xcode
2
+ #
3
+ build/
4
+ *.pbxuser
5
+ !default.pbxuser
6
+ *.mode1v3
7
+ !default.mode1v3
8
+ *.mode2v3
9
+ !default.mode2v3
10
+ *.perspectivev3
11
+ !default.perspectivev3
12
+ xcuserdata
13
+ *.xccheckout
14
+ *.moved-aside
15
+ DerivedData
16
+ *.hmap
17
+ *.ipa
18
+ *.xcuserstate
19
+
20
+ # CocoaPods
21
+ #
22
+ # We recommend against adding the Pods directory to your .gitignore. However
23
+ # you should judge for yourself, the pros and cons are mentioned at:
24
+ # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25
+ #
26
+ # Pods/
@@ -0,0 +1,14 @@
1
+ build/
2
+ *.pbxuser
3
+ !default.pbxuser
4
+ *.mode1v3
5
+ !default.mode1v3
6
+ *.mode2v3
7
+ !default.mode2v3
8
+ *.perspectivev3
9
+ !default.perspectivev3
10
+ xcuserdata
11
+ *.xccheckout
12
+ *.moved-aside
13
+ DerivedData
14
+ *.xcuserstate
@@ -0,0 +1,9 @@
1
+ .vagrant
2
+ /cookbooks
3
+
4
+ # Bundler
5
+ bin/*
6
+ .bundle/*
7
+
8
+ .kitchen/
9
+ .kitchen.local.yml
@@ -0,0 +1,4 @@
1
+ *~
2
+
3
+ # KDE directory preferences
4
+ .directory
@@ -0,0 +1,28 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+
5
+ # Runtime data
6
+ pids
7
+ *.pid
8
+ *.seed
9
+
10
+ # Directory for instrumented libs generated by jscoverage/JSCover
11
+ lib-cov
12
+
13
+ # Coverage directory used by tools like istanbul
14
+ coverage
15
+
16
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17
+ .grunt
18
+
19
+ # Compiled binary addons (http://nodejs.org/api/addons.html)
20
+ build/Release
21
+
22
+ # Dependency directory
23
+ # Commenting this out is preferred by some people, see
24
+ # https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
25
+ node_modules
26
+
27
+ # Users Environment Variables
28
+ .lock-wscript
@@ -0,0 +1,6 @@
1
+ node_modules/
2
+ bower_components/
3
+ *.log
4
+
5
+ build/
6
+ dist/
@@ -0,0 +1,9 @@
1
+ .vagrant
2
+ /cookbooks
3
+
4
+ # Bundler
5
+ bin/*
6
+ .bundle/*
7
+
8
+ .kitchen/
9
+ .kitchen.local.yml
@@ -0,0 +1,4 @@
1
+ *~
2
+
3
+ # KDE directory preferences
4
+ .directory
@@ -0,0 +1,26 @@
1
+ *.rbc
2
+ capybara-*.html
3
+ .rspec
4
+ /log
5
+ /tmp
6
+ /db/*.sqlite3
7
+ /public/system
8
+ /coverage/
9
+ /spec/tmp
10
+ **.orig
11
+ rerun.txt
12
+ pickle-email-*.html
13
+
14
+ # TODO Comment out these rules if you are OK with secrets being uploaded to the repo
15
+ config/initializers/secret_token.rb
16
+ config/secrets.yml
17
+
18
+ ## Environment normalisation:
19
+ /.bundle
20
+ /vendor/bundle
21
+
22
+ # these should all be checked in to normalise the environment:
23
+ # Gemfile.lock, .ruby-version, .ruby-gemset
24
+
25
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
26
+ .rvmrc
@@ -0,0 +1,34 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
@@ -18,11 +18,9 @@ module Forgitter
18
18
  opts.separator ''
19
19
  opts.separator 'Specific options:'
20
20
 
21
- opts.on('-l', '--list [TAGS]',
22
- 'List the available types. You may optionally provide a comma-separated list of tags to search for.') do |tags|
23
- tags = tags.nil? ? [] : tags.split(',')
24
- Forgitter.list_types(tags)
25
- exit
21
+ opts.on('-l', '--list',
22
+ 'Instead of generating a .gitignore, list the types that match the tags.') do
23
+ options[:list] = true
26
24
  end
27
25
 
28
26
  opts.on('-c', '--stdout',
@@ -2,6 +2,7 @@ require 'forgitter/types'
2
2
 
3
3
  module Forgitter
4
4
  DEFAULT_OPTIONS = {
5
+ :list => false,
5
6
  :tags => [],
6
7
  :stdout => false
7
8
  }
@@ -3,7 +3,7 @@ require 'forgitter'
3
3
  module Forgitter
4
4
  class Runner
5
5
  def initialize(options = Forgitter::DEFAULT_OPTIONS)
6
- @types = Forgitter.filter_types(options[:tags])
6
+ @types = Forgitter.filter_types(options)
7
7
  @stdout = options[:stdout]
8
8
  end
9
9
 
@@ -1,4 +1,3 @@
1
- require 'debugger'
2
1
  module Forgitter
3
2
  ##
4
3
  # Strip unnecessary characters and downcase the given string.
@@ -11,27 +10,37 @@ module Forgitter
11
10
  end
12
11
 
13
12
  ##
14
- # Filter types by tags.
13
+ # Filter types by tags, then by name.
15
14
  #
16
15
  # If tags is empty, this will return all types.
17
16
  #
18
- # @param [Array] the array of type names and/or tag strings
17
+ # @param [Hash] the hash of options containing tag strings
19
18
  # @return [Array] the array of filtered types
20
19
  #
21
- def self.filter_types(tags = [])
20
+ def self.filter_types(options = {})
21
+ return types if options[:tags].empty?
22
+
22
23
  types.select do |type|
23
- tags.empty? || (tags - type[:tags]).empty? || tags.include?(type[:name])
24
+ selected = true
25
+ options[:tags].uniq.each do |tag|
26
+ selected &&= type[:tags].count(tag) >= options[:tags].count(tag)
27
+ end
28
+ selected
24
29
  end
25
30
  end
26
31
 
27
32
  ##
28
33
  # Fetch all available type paths, relative to the DATA_PATH.
29
34
  #
35
+ # .gitignore files placed directly under DATA_PATH are ignored.
36
+ #
30
37
  # @return [Array] the array of available type paths
31
38
  #
32
39
  def self.paths
33
40
  @@paths ||= Dir["#{DATA_PATH}/**/*.gitignore"].map do |path|
34
41
  path.sub("#{DATA_PATH}/", '')
42
+ end.select do |path|
43
+ path =~ /\//
35
44
  end
36
45
  end
37
46
 
@@ -48,7 +57,7 @@ module Forgitter
48
57
  ##
49
58
  # Pull parameterized tags out of the given path.
50
59
  #
51
- # If path does not contain a /, this returns an empty array.
60
+ # If path does not contain a /, this just returns the type name in an array.
52
61
  #
53
62
  # @param [String] the path to a .gitignore file
54
63
  # @return [Array] the tags
@@ -61,6 +70,7 @@ module Forgitter
61
70
  parameterize(tag)
62
71
  end
63
72
  end
73
+ tags << type(path)
64
74
  tags
65
75
  end
66
76
 
@@ -85,7 +95,7 @@ module Forgitter
85
95
  end
86
96
 
87
97
  def self.list_types(tags = [])
88
- types = filter_types(tags)
98
+ types = filter_types({ :tags => tags })
89
99
  if types.empty?
90
100
  puts 'No types found!'
91
101
  else
@@ -93,8 +103,9 @@ module Forgitter
93
103
  col1size = 0
94
104
 
95
105
  types.each do |type|
96
- col1size = type[:name].length if type[:name].length > col1size
97
- lines << [type[:name], type[:path]]
106
+ id = type[:tags].join(' ')
107
+ col1size = id.length if id.length > col1size
108
+ lines << [id, type[:path]]
98
109
  end
99
110
 
100
111
  lines.sort_by { |line| line[0] }.each do |line|
@@ -1,3 +1,3 @@
1
1
  module Forgitter
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forgitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Dunson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-22 00:00:00.000000000 Z
12
+ date: 2014-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -70,6 +70,20 @@ files:
70
70
  - README.md
71
71
  - Rakefile
72
72
  - bin/forgitter
73
+ - data/cloudspace/android/Android.gitignore
74
+ - data/cloudspace/android/Eclipse.gitignore
75
+ - data/cloudspace/android/OSX.gitignore
76
+ - data/cloudspace/ios/OSX.gitignore
77
+ - data/cloudspace/ios/Objective-C.gitignore
78
+ - data/cloudspace/ios/Xcode.gitignore
79
+ - data/cloudspace/javascript/ChefCookbook.gitignore
80
+ - data/cloudspace/javascript/Linux.gitignore
81
+ - data/cloudspace/javascript/Node.gitignore
82
+ - data/cloudspace/javascript/Yeoman.gitignore
83
+ - data/cloudspace/rails/ChefCookbook.gitignore
84
+ - data/cloudspace/rails/Linux.gitignore
85
+ - data/cloudspace/rails/Rails.gitignore
86
+ - data/cloudspace/rails/Ruby.gitignore
73
87
  - data/github/Actionscript.gitignore
74
88
  - data/github/Ada.gitignore
75
89
  - data/github/Agda.gitignore