ruby_leiningen 0.0.2 → 0.1.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
  SHA256:
3
- metadata.gz: 316e4ca6e8ffada3804265bd7ad13cf6b3b7429d2f42c1028428123f33c305d8
4
- data.tar.gz: '084d1870b9765988b476d569a01c2f708e6aff40df0fff316baa17c4b9bfcfaa'
3
+ metadata.gz: a93d524bfab0733fa2d9ce5c56929a2b4a1f925b17e7c1dd3ffd68cf263115b9
4
+ data.tar.gz: 7d6c7a75761afac578208406d351e7c3d9f1961fdecf24ebb6adb59c80e9953f
5
5
  SHA512:
6
- metadata.gz: 4ca917f50653852288419e03699e4f44db49a2f84da59f44436d9b23efc686716fdcdd7ac604ffbb3388cc9d0384815da8fe3af08685cf066f4244edd6889ff2
7
- data.tar.gz: bd34162ef7a16c488491a8e87b9cf4a2f675f037b6822c2df574653cfcfd52ccc195b9372284423a4440a321c75c05d0c80ccff8e3e3b7f35c1b4b0118fe6193
6
+ metadata.gz: e9d1c6032b8b6d1d4cc7a494f57387125013035a968c0d383de536f6d727e3c3ea8c948a049157b10a61c879d318a0103538f0e85b2702940dfc188a55a7d13e
7
+ data.tar.gz: 6cfb5c7e1bfda16822e56645268c0efebdf1a755cb41c9348fb77184c8fc45c18010330f0f00e3a69dc9f83c83a7951513db811ca1f66c990294835682c08426
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_leiningen (0.0.2)
4
+ ruby_leiningen (0.1.0)
5
5
  activesupport (~> 6.0, >= 6.0.2)
6
6
  lino (~> 1.1)
7
7
 
@@ -56,4 +56,4 @@ DEPENDENCIES
56
56
  ruby_leiningen!
57
57
 
58
58
  BUNDLED WITH
59
- 2.1.0
59
+ 2.1.1
@@ -13,7 +13,6 @@ module RubyLeiningen
13
13
  class << self
14
14
  def define_custom_command(name, options = {}, &config_block)
15
15
  klass_name = name.classify
16
- config = (config_block || lambda { |conf| conf }).call(Config.new)
17
16
 
18
17
  klass = Class.new(Base) do
19
18
  unless options[:include_profile_support] == false
@@ -21,11 +20,14 @@ module RubyLeiningen
21
20
  end
22
21
 
23
22
  define_method "configure_command" do |builder, opts|
23
+ config = (config_block || lambda { |conf, _| conf })
24
+ .call(Config.new, opts)
25
+
24
26
  builder = super(builder, opts)
25
27
  builder = builder.with_subcommand(name) do |sub|
26
- config.subcommand_block.call(sub, opts)
28
+ config.subcommand_block.call(sub)
27
29
  end
28
- config.command_block.call(builder, opts)
30
+ config.command_block.call(builder)
29
31
  end
30
32
  end
31
33
 
@@ -39,8 +41,8 @@ module RubyLeiningen
39
41
  attr_accessor :command_block, :subcommand_block
40
42
 
41
43
  def initialize
42
- self.command_block = lambda { |com, _| com }
43
- self.subcommand_block = lambda { |sub, _| sub }
44
+ self.command_block = lambda { |command| command }
45
+ self.subcommand_block = lambda { |sub| sub }
44
46
  end
45
47
 
46
48
  def on_command_builder(&block)
@@ -0,0 +1,51 @@
1
+ require_relative '../../commands'
2
+
3
+ RubyLeiningen::Commands.define_custom_command("bikeshed") do |config, opts|
4
+ show_help = opts[:show_help]
5
+ verbose = opts[:verbose]
6
+ maximum_line_length = opts[:maximum_line_length]
7
+ long_lines = opts[:long_lines]
8
+ trailing_whitespace = opts[:trailing_whitespace]
9
+ trailing_blank_lines = opts[:trailing_blank_lines]
10
+ var_redefs = opts[:var_redefs]
11
+ docstrings = opts[:docstrings]
12
+ name_collisions = opts[:name_collisions]
13
+ exclude_profiles = opts[:exclude_profiles]
14
+
15
+ config.on_subcommand_builder do |command|
16
+ unless show_help.nil?
17
+ command = command.with_flag(show_help ? '--help-me' : '--no-help-me')
18
+ end
19
+ unless verbose.nil?
20
+ command = command.with_flag(verbose ? '--verbose' : '--no-verbose')
21
+ end
22
+ if maximum_line_length
23
+ command = command.with_option('--max-line-length', maximum_line_length)
24
+ end
25
+ unless long_lines.nil?
26
+ command = command.with_option('--long-lines', long_lines)
27
+ end
28
+ unless trailing_whitespace.nil?
29
+ command = command
30
+ .with_option('--trailing-whitespace', trailing_whitespace)
31
+ end
32
+ unless trailing_blank_lines.nil?
33
+ command = command
34
+ .with_option('--trailing-blank-lines', trailing_blank_lines)
35
+ end
36
+ unless var_redefs.nil?
37
+ command = command.with_option('--var-redefs', var_redefs)
38
+ end
39
+ unless docstrings.nil?
40
+ command = command.with_option('--docstrings', docstrings)
41
+ end
42
+ unless name_collisions.nil?
43
+ command = command.with_option('--name-collisions', name_collisions)
44
+ end
45
+ unless exclude_profiles.nil?
46
+ command = command
47
+ .with_option('--exclude-profiles', exclude_profiles.join(","))
48
+ end
49
+ command
50
+ end
51
+ end
@@ -0,0 +1,13 @@
1
+ require_relative '../../commands'
2
+
3
+ RubyLeiningen::Commands.define_custom_command("cljfmt") do |config, opts|
4
+ mode = opts[:mode] || :check
5
+ paths = opts[:paths] || []
6
+
7
+ config.on_command_builder do |command|
8
+ command = command.with_subcommand(mode.to_s)
9
+ paths.inject(command) do |c, path|
10
+ c.with_argument(path)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,8 @@
1
+ require_relative '../../commands'
2
+
3
+ RubyLeiningen::Commands.define_custom_command("eastwood") do |config, opts|
4
+ config.on_command_builder do |command|
5
+ command = command.with_argument("\"#{opts[:config]}\"") if opts[:config]
6
+ command
7
+ end
8
+ end
@@ -0,0 +1,27 @@
1
+ require_relative '../../commands'
2
+
3
+ RubyLeiningen::Commands.define_custom_command("eftest") do |config, opts|
4
+ only = opts[:only] ? [":only #{opts[:only]}"] : []
5
+ specific = (opts[:test_selectors] || []).map { |m| ":#{m}" }
6
+ all = [":all"]
7
+
8
+ test_selectors =
9
+ if only.any?
10
+ only
11
+ elsif specific.any?
12
+ specific
13
+ else
14
+ all
15
+ end
16
+
17
+ namespaces = opts[:namespaces] || []
18
+ files = opts[:files] || []
19
+
20
+ arguments = namespaces.concat(files).concat(test_selectors)
21
+
22
+ config.on_command_builder do |command|
23
+ arguments.inject(command) do |c, arg|
24
+ c.with_argument(arg)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,18 @@
1
+ require_relative '../../commands'
2
+
3
+ RubyLeiningen::Commands.define_custom_command("kibit") do |config, opts|
4
+ paths = opts[:paths] || []
5
+
6
+ config.on_subcommand_builder do |command|
7
+ command = command.with_flag("--replace") if opts[:replace]
8
+ command = command.with_flag("--interactive") if opts[:interactive]
9
+ command = command
10
+ .with_option("--reporter", opts[:reporter]) if opts[:reporter]
11
+ command
12
+ end
13
+ config.on_command_builder do |subcommand|
14
+ paths.inject(subcommand) do |s, path|
15
+ s.with_argument(path)
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module RubyLeiningen
2
- VERSION = '0.0.2'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_leiningen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-16 00:00:00.000000000 Z
11
+ date: 2019-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lino
@@ -141,6 +141,11 @@ files:
141
141
  - lib/ruby_leiningen/commands/clean.rb
142
142
  - lib/ruby_leiningen/commands/deps.rb
143
143
  - lib/ruby_leiningen/commands/mixins/profile.rb
144
+ - lib/ruby_leiningen/commands/plugins/bikeshed.rb
145
+ - lib/ruby_leiningen/commands/plugins/cljfmt.rb
146
+ - lib/ruby_leiningen/commands/plugins/eastwood.rb
147
+ - lib/ruby_leiningen/commands/plugins/eftest.rb
148
+ - lib/ruby_leiningen/commands/plugins/kibit.rb
144
149
  - lib/ruby_leiningen/commands/run.rb
145
150
  - lib/ruby_leiningen/commands/uberjar.rb
146
151
  - lib/ruby_leiningen/commands/version.rb