guard-sublime-ctags 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in guard-sublime-ctags.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Sunteya
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,30 @@
1
+ # Guard::Sublime-Ctags
2
+
3
+ Guard::Sublime-Ctags allows you to automatically run ctag command when files are modified.
4
+ the generated files compatible with default sublime text2's [ctags plugin](https://github.com/SublimeText/CTags).
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'guard-sublime-ctags'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Add guard definitions to your Guardfile by running:
17
+
18
+ $ guard init sublime-ctags
19
+
20
+ ## Usage
21
+
22
+ Please read [Guard usage doc](https://github.com/guard/guard#readme)
23
+
24
+ ## Contributing
25
+
26
+ 1. Fork it
27
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
28
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
29
+ 4. Push to the branch (`git push origin my-new-feature`)
30
+ 5. Create new Pull Request
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+
4
+ require 'rake/version_task'
5
+ Rake::VersionTask.new
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ Gem::Specification.new do |gem|
3
+ gem.authors = ["sunteya"]
4
+ gem.email = ["sunteya@gmail.com"]
5
+ gem.description = %q{it allows you to automatically run ctag command when files are modified.
6
+ the generated files compatible with default sublime text's ctags plugin.}
7
+ gem.summary = %q{guard for sublime text's ctag plugin}
8
+ gem.homepage = "https://github.com/sunteya/guard-sublime-ctags"
9
+
10
+ gem.files = `git ls-files`.split($\)
11
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
12
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
+ gem.name = "guard-sublime-ctags"
14
+ gem.require_paths = ["lib"]
15
+ gem.version = File.read(File.expand_path("../VERSION", __FILE__)).chomp
16
+
17
+ gem.add_dependency "guard"
18
+ gem.add_dependency "gemtags"
19
+
20
+ gem.add_development_dependency "rake"
21
+ gem.add_development_dependency "version"
22
+ end
@@ -0,0 +1,45 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+
6
+ class SublimeCtags < Guard
7
+
8
+ def initialize(watchers = [], options = {})
9
+ super
10
+ end
11
+
12
+ def start
13
+ self.gen_ctags
14
+ end
15
+
16
+ def reload
17
+ self.gen_ctags
18
+ end
19
+
20
+ def run_on_changes(paths)
21
+ self.gen_ctags(paths)
22
+ end
23
+
24
+ def run_on_removals(paths)
25
+ self.gen_ctags
26
+ end
27
+
28
+ def ctags_file
29
+ ".tags"
30
+ end
31
+
32
+ def gen_ctags(files = [])
33
+ if files.empty?
34
+ command = "ctags -R -f #{ctags_file}"
35
+ puts "exec #{command}"
36
+ system command
37
+ else
38
+ command = "ctags -f #{ctags_file} --append=yes " + files.map{|f| "'#{f}'" }.join(" ")
39
+ puts "exec #{command}"
40
+ system command
41
+ end
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,7 @@
1
+ guard 'sublime-ctags' do
2
+ watch(%r{^(app|config|lib|vendor).*(/[^.][^/]+$)})
3
+ end
4
+
5
+ guard 'sublime-gemtags' do
6
+ watch("Gemfile.lock")
7
+ end
@@ -0,0 +1,41 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+ require 'gemtags'
4
+
5
+ module Guard
6
+
7
+ class SublimeGemtags < Guard
8
+
9
+ def initialize(watchers = [], options = {})
10
+ super
11
+ end
12
+
13
+ def start
14
+ self.gen_gemtags
15
+ end
16
+
17
+ def reload
18
+ self.gen_gemtags
19
+ end
20
+
21
+ def run_on_changes(paths)
22
+ self.gen_gemtags(paths)
23
+ end
24
+
25
+ def gemtags_file
26
+ ".gemtags"
27
+ end
28
+
29
+ def gen_gemtags(paths = [])
30
+ if File.exists?(gemtags_file)
31
+ mtime = paths.map {|path| File.mtime(path) }.max
32
+ return if mtime && mtime <= File.mtime(gemtags_file)
33
+ end
34
+
35
+ command = "bundle exec gemtags"
36
+ puts "exec #{command}"
37
+ system command
38
+ end
39
+
40
+ end
41
+ end
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-sublime-ctags
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - sunteya
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-07-16 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: guard
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: gemtags
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: version
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: ! "it allows you to automatically run ctag command when files are modified.
79
+ \nthe generated files compatible with default sublime text's ctags plugin."
80
+ email:
81
+ - sunteya@gmail.com
82
+ executables: []
83
+ extensions: []
84
+ extra_rdoc_files: []
85
+ files:
86
+ - .gitignore
87
+ - Gemfile
88
+ - LICENSE
89
+ - README.md
90
+ - Rakefile
91
+ - VERSION
92
+ - guard-sublime-ctags.gemspec
93
+ - lib/guard/sublime-ctags.rb
94
+ - lib/guard/sublime-ctags/templates/Guardfile
95
+ - lib/guard/sublime-gemtags.rb
96
+ homepage: https://github.com/sunteya/guard-sublime-ctags
97
+ licenses: []
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ! '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ segments:
109
+ - 0
110
+ hash: 738099227201155532
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ segments:
118
+ - 0
119
+ hash: 738099227201155532
120
+ requirements: []
121
+ rubyforge_project:
122
+ rubygems_version: 1.8.24
123
+ signing_key:
124
+ specification_version: 3
125
+ summary: guard for sublime text's ctag plugin
126
+ test_files: []