stylecheck 0.1.0 → 0.2.0

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.
File without changes
data/lib/rake_tasks.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'rake'
2
+ load 'tasks/stylecheck.rake'
@@ -0,0 +1,12 @@
1
+ require 'stylecheck'
2
+ require 'rails'
3
+
4
+ module Stylecheck
5
+ class Railtie < Rails::Railtie
6
+ railtie_name :stylecheck
7
+
8
+ rake_tasks do
9
+ load 'tasks/stylecheck.rake'
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Stylecheck
2
- VERSION = "0.1.0"
2
+ VERSION = '0.2.0'.freeze
3
3
  end
data/lib/stylecheck.rb CHANGED
@@ -1,5 +1,4 @@
1
- require "stylecheck/version"
2
1
 
3
2
  module Stylecheck
4
- # Your code goes here...
3
+ require 'stylecheck/railtie' if defined?(Rails)
5
4
  end
@@ -0,0 +1,39 @@
1
+ desc 'Stylecheck for ruby and scss'
2
+ task stylecheck: 'stylecheck:all'
3
+
4
+ namespace :stylecheck do
5
+ desc "Copies default configs"
6
+ task :init do
7
+ default_rubocop_config_path = File.join(Gem.loaded_specs["stylecheck"].full_gem_path, "config/stylecheck", "rubocop.yml")
8
+ target_dir = FileUtils.mkdir_p("./config/stylecheck")
9
+ app_rubocop_config_path = File.join(target_dir, "rubocop.yml" )
10
+ FileUtils.cp_r(default_rubocop_config_path, app_rubocop_config_path)
11
+
12
+ default_scss_config_path = File.join(Gem.loaded_specs["stylecheck"].full_gem_path, "config/stylecheck", "scss-lint.yml")
13
+ app_scss_config_path = File.join(target_dir, "scss-lint.yml" )
14
+ FileUtils.cp_r(default_scss_config_path, app_scss_config_path)
15
+ end
16
+
17
+ desc 'Stylecheck for ruby'
18
+ task :ruby do
19
+ sh 'bundle exec rubocop --config config/stylecheck/rubocop.yml'
20
+ end
21
+
22
+ desc 'Stylecheck for scss'
23
+ task :scss do
24
+ sh 'bundle exec scss-lint --config config/stylecheck/scss-lint.yml'
25
+ end
26
+
27
+ task :all do
28
+ failed_task = false
29
+ %W[stylecheck:ruby stylecheck:scss].each do |task_name|
30
+ begin
31
+ Rake::Task[task_name].invoke
32
+ rescue => e
33
+ failed_task = true
34
+ puts "Task #{ task_name } failed with message: #{ e.message }"
35
+ end
36
+ end
37
+ raise 'Task failed!' if failed_task
38
+ end
39
+ end
metadata CHANGED
@@ -1,76 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stylecheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soumya Veer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-28 00:00:00.000000000 Z
11
+ date: 2017-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: rubocop
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.13'
20
- type: :development
19
+ version: 0.46.0
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.13'
26
+ version: 0.46.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: scss_lint
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.51.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.51.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '10.0'
47
+ version: 1.13.4
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '10.0'
54
+ version: 1.13.4
41
55
  - !ruby/object:Gem::Dependency
42
- name: rspec
56
+ name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '3.0'
61
+ version: '10.0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '3.0'
55
- description: Automate stylecheck for ruby and scss
68
+ version: '10.0'
69
+ description: Code stylechek automation
56
70
  email:
57
71
  - veer.soumya@gmail.com
58
72
  executables: []
59
73
  extensions: []
60
74
  extra_rdoc_files: []
61
75
  files:
62
- - ".gitignore"
63
- - ".rspec"
64
- - ".travis.yml"
65
- - Gemfile
66
- - LICENSE.txt
67
- - README.md
68
- - Rakefile
69
- - bin/console
70
- - bin/setup
76
+ - config/stylecheck/rubocop.yml
77
+ - config/stylecheck/scss-lint.yml
78
+ - lib/rake_tasks.rb
71
79
  - lib/stylecheck.rb
80
+ - lib/stylecheck/railtie.rb
72
81
  - lib/stylecheck/version.rb
73
- - stylecheck.gemspec
82
+ - lib/tasks/stylecheck.rake
74
83
  homepage: ''
75
84
  licenses:
76
85
  - MIT
@@ -94,5 +103,5 @@ rubyforge_project:
94
103
  rubygems_version: 2.5.1
95
104
  signing_key:
96
105
  specification_version: 4
97
- summary: Code stylecheck automation
106
+ summary: Automate stylecheck for ruby and scss.
98
107
  test_files: []
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- .idea
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.1
5
- before_install: gem install bundler -v 1.13.6
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in stylecheck.gemspec
4
- gemspec
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2016 Soumya Veer
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/README.md DELETED
@@ -1,41 +0,0 @@
1
- # Stylecheck
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/stylecheck`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'stylecheck'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install stylecheck
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- 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`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/stylecheck.
36
-
37
-
38
- ## License
39
-
40
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "stylecheck"
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 DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/stylecheck.gemspec DELETED
@@ -1,36 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'stylecheck/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "stylecheck"
8
- spec.version = Stylecheck::VERSION
9
- spec.authors = ["Soumya Veer"]
10
- spec.email = ["veer.soumya@gmail.com"]
11
-
12
- spec.summary = %q{Code stylecheck automation}
13
- spec.description = %q{Automate stylecheck for ruby and scss}
14
- spec.homepage = ""
15
- spec.license = "MIT"
16
-
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- # if spec.respond_to?(:metadata)
20
- # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
- # else
22
- # raise "RubyGems 2.0 or newer is required to protect against " \
23
- # "public gem pushes."
24
- # end
25
-
26
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
- f.match(%r{^(test|spec|features)/})
28
- end
29
- spec.bindir = "exe"
30
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
- spec.require_paths = ["lib"]
32
-
33
- spec.add_development_dependency "bundler", "~> 1.13"
34
- spec.add_development_dependency "rake", "~> 10.0"
35
- spec.add_development_dependency "rspec", "~> 3.0"
36
- end