guard-rubybeautify 0.90.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 211d01579dc13c1c6ca8a05769c266d76f499db2
4
+ data.tar.gz: 8449a81944705829b6af604621a27bbbd284ad07
5
+ SHA512:
6
+ metadata.gz: dbb8231b2019496d25046bfe0e65457ee00b4cf37a33c16fffadf1c1add9573b80d5286d99a6f7fe9f1a84d19df535351430d228d371b2e7d8e48cb68cfc5f88
7
+ data.tar.gz: 795f4e52638ee9be52cc1eb03bde13ce06732470633de5ff6b6f1346d37afaed501b68aa54cec1e1b708be6df42a5cd136bcf36c26a2aeac83a62c7c7a054c0e
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.3
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in guard-rubybeautify.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # Guard::Rubybeautify
2
+
3
+ A guard to automatically beautify ruby files in a project.
4
+
5
+ ## Installation
6
+
7
+ Please be sure to have [Guard](https://github.com/guard/guard) installed before continuing.
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'guard-rubybeautify'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install guard-rubybeautify
22
+
23
+ ## Usage
24
+
25
+ Add a guardfile entry:
26
+
27
+ ```ruby
28
+ guard :rubybeautify do
29
+ watch(%r{lib/.+\.rb})
30
+ end
31
+ ```
32
+
33
+ or call
34
+
35
+ $ guard init rubybeautify
36
+
37
+ to have a section added automatically.
38
+
39
+ ## Development
40
+
41
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
42
+
43
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
44
+
45
+ ## Contributing
46
+
47
+ 1. Fork it ( https://github.com/[my-github-username]/guard-rubybeautify/fork )
48
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
49
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
50
+ 4. Push to the branch (`git push origin my-new-feature`)
51
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "guard/rubybeautify"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'guard/rubybeautify/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "guard-rubybeautify"
8
+ spec.version = Guard::RubybeautifyVersion::VERSION
9
+ spec.authors = ["Ernie Brodeur"]
10
+ spec.email = ["ebrodeur@ujami.net"]
11
+
12
+ spec.summary = "Clean up ruby files with ruby beautify."
13
+ spec.description = "Automatically triggers ruby beautify against changes to attempt to clean them up."
14
+ spec.homepage = "https://github.com/erniebrodeur/guard-rubybeautify"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'guard-compat', '~> 1.1'
22
+ spec.add_dependency 'ruby-beautify'
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.9"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ end
@@ -0,0 +1,4 @@
1
+ # Add any file/pattern you want to have beautified beyond these.
2
+ guard :rubybeautify do
3
+ watch(%r{lib/.+\.rb})
4
+ end
@@ -0,0 +1,5 @@
1
+ module Guard
2
+ module RubybeautifyVersion
3
+ VERSION = "0.90.0"
4
+ end
5
+ end
@@ -0,0 +1,28 @@
1
+ require "guard/rubybeautify/version"
2
+ require 'guard/compat/plugin'
3
+
4
+ module Guard
5
+ class Rubybeautify < Plugin
6
+ attr_accessor :count, :style
7
+
8
+ def initialize(options = {})
9
+ super
10
+ @options = {
11
+ count: 1,
12
+ style: :tabs
13
+ }.merge(options)
14
+ end
15
+
16
+ def run_on_modifications(paths)
17
+ unless @beautified
18
+ @beautified = true
19
+ paths.each do |file|
20
+ `ruby-beautify #{file} --overwrite`
21
+ Compat::UI.info "Ruby beautify executed against #{file}"
22
+ end
23
+ else
24
+ @beautified = false
25
+ end
26
+ end
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-rubybeautify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.90.0
5
+ platform: ruby
6
+ authors:
7
+ - Ernie Brodeur
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-06-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: guard-compat
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ruby-beautify
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.9'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.9'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ description: Automatically triggers ruby beautify against changes to attempt to clean
70
+ them up.
71
+ email:
72
+ - ebrodeur@ujami.net
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".travis.yml"
79
+ - CODE_OF_CONDUCT.md
80
+ - Gemfile
81
+ - README.md
82
+ - Rakefile
83
+ - bin/console
84
+ - bin/setup
85
+ - guard-rubybeautify.gemspec
86
+ - lib/guard/rubybeautify.rb
87
+ - lib/guard/rubybeautify/templates/Guardfile
88
+ - lib/guard/rubybeautify/version.rb
89
+ homepage: https://github.com/erniebrodeur/guard-rubybeautify
90
+ licenses: []
91
+ metadata: {}
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ requirements: []
107
+ rubyforge_project:
108
+ rubygems_version: 2.2.2
109
+ signing_key:
110
+ specification_version: 4
111
+ summary: Clean up ruby files with ruby beautify.
112
+ test_files: []