meowcop 1.7.0 → 1.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 222f4dd5c3aadc7c51c68a35a5bea7fbc5b1e70a
4
- data.tar.gz: 94f8021345488d60a5a9fe698fa24c3ceb530523
3
+ metadata.gz: 0c87fb206843ff45e5ece8c7e50a523e31de6b92
4
+ data.tar.gz: 7de2c9994b98244fc6f344a91c19f13759993518
5
5
  SHA512:
6
- metadata.gz: ee1e66a8c570a96f5ec5e6f1f8bfad9320350586dd204126ecbbcd872526d7177523c91668cc295462ac113693ecf2c3154d4828f3b0cdbe59d6b4aa7e18f508
7
- data.tar.gz: 1298d91e6fb4a3ac436100c180adc2859fe2551f97b6eeccdbf290006df2ed29717043ee1db6891b685a20d273a11915d5ce34148ebcbce0f796059deafb696e
6
+ metadata.gz: 00f895bf2b089b8b7b4891d4b28fbc24c3bb4a28f22fb9b21153ebd52709f006e75db0673d5f8b931bfb60d6cf3e4b8d725160a233dabfaba712efb68173e597
7
+ data.tar.gz: a018de299c0beed4f4633c08323a97883aaa851f434cb341ed3f92db9c2020daae28922243d2be0c88d6e2413b150c75819a00d86b2fa18771a01d09894784a9
@@ -3,10 +3,12 @@ inherit_gem:
3
3
  meowcop:
4
4
  - config/rubocop.yml
5
5
 
6
+ # Modify the version if you don't use MRI 2.1.
7
+ AllCops:
8
+ TargetRubyVersion: 2.1
6
9
 
7
10
  # You can customize rubocop settings.
8
11
  # For example.
9
-
10
- Style/FrozenStringLiteralComment:
11
- Enabled: true
12
- EnforcedStyle: always
12
+ # Style/FrozenStringLiteralComment:
13
+ # Enabled: true
14
+ # EnforcedStyle: always
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
4
+
5
+ require "meowcop"
6
+
7
+ exit Meowcop::CLI.start(ARGV)
@@ -1,4 +1,5 @@
1
1
  require "meowcop/version"
2
+ require 'meowcop/cli'
2
3
 
3
4
  module Meowcop
4
5
  # Your code goes here...
@@ -0,0 +1,80 @@
1
+ # Original: https://github.com/onk/onkcop
2
+ #
3
+ # The MIT License (MIT)
4
+ #
5
+ # Copyright (c) 2015 Takafumi ONAKA
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ # THE SOFTWARE.
24
+ require 'fileutils'
25
+
26
+ module Meowcop
27
+ class CLI
28
+ CONFIG_FILE_NAME = ".rubocop.yml".freeze
29
+
30
+ def self.start(args)
31
+ action_name = args.shift || 'help'
32
+
33
+ instance = self.new
34
+ unless instance.public_methods(false).include?(action_name.to_sym)
35
+ puts "Could not find command #{action_name}."
36
+ action_name = 'help'
37
+ end
38
+
39
+ instance.public_send(action_name, args)
40
+ end
41
+
42
+ def init(_args)
43
+ action = File.exist?(CONFIG_FILE_NAME) ? "overwrited" : "created"
44
+ FileUtils.copy_file(config_file_path, CONFIG_FILE_NAME)
45
+ puts "Meow! #{CONFIG_FILE_NAME} has been #{action} successfully."
46
+
47
+ return 0
48
+ end
49
+
50
+ def run(args)
51
+ require 'rubocop'
52
+
53
+ cli = RuboCop::CLI.new
54
+ args = [
55
+ '--config', config_file_path,
56
+ *args
57
+ ]
58
+ cli.run(args)
59
+ end
60
+
61
+ def help(_args)
62
+ msg = <<-END
63
+ MeowCop commands:
64
+ init - Setup .rubocop.yml
65
+ help - Show this message
66
+ run - Run RuboCop with MeowCop
67
+ END
68
+ puts msg
69
+
70
+ return 0
71
+ end
72
+
73
+ private
74
+
75
+ def config_file_path
76
+ template_path = File.expand_path("../../examples", __dir__)
77
+ File.join(template_path, CONFIG_FILE_NAME)
78
+ end
79
+ end
80
+ end
@@ -1,3 +1,3 @@
1
1
  module Meowcop
2
- VERSION = "1.7.0"
2
+ VERSION = "1.8.0"
3
3
  end
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_dependency 'rubocop'
22
+
21
23
  spec.add_development_dependency "bundler", "~> 1.12"
22
24
  spec.add_development_dependency "rake", "~> 10.0"
23
25
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meowcop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masataka Kuwabara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-16 00:00:00.000000000 Z
11
+ date: 2017-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -41,7 +55,8 @@ dependencies:
41
55
  description: MeowCop is a RuboCop configuration recommended by Actcat inc.
42
56
  email:
43
57
  - p.ck.t22@gmail.com
44
- executables: []
58
+ executables:
59
+ - meowcop
45
60
  extensions: []
46
61
  extra_rdoc_files: []
47
62
  files:
@@ -53,7 +68,9 @@ files:
53
68
  - bin/setup
54
69
  - config/rubocop.yml
55
70
  - examples/.rubocop.yml
71
+ - exe/meowcop
56
72
  - lib/meowcop.rb
73
+ - lib/meowcop/cli.rb
57
74
  - lib/meowcop/version.rb
58
75
  - meowcop.gemspec
59
76
  homepage: https://github.com/sideci/meowcop