rake_leiningen 0.33.0.pre.2 → 0.33.0.pre.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 605f65b1e7db73ff5fe1b616ebdcf6540886dc5c3d25be6bb089ca2464838d5a
4
- data.tar.gz: c620d25d8bbec3a21dab696c4287ad63533d35bc9c34a49b9426fcdd8a3fd31b
3
+ metadata.gz: 2146decde23141378540761b2714f76657b74d17a6604236e4805fb40bd29186
4
+ data.tar.gz: 93fe4be4ee9ad66480901755dec3193190497b1140796b843c57ded4031d891f
5
5
  SHA512:
6
- metadata.gz: a3572cb502e798a5649d59448121ed8d7ad06246fa044f437510aeda3457968bec65958c954eb838cc3aa6236f2e1b4fd3852ad8a927373b9b8d7601096bc44a
7
- data.tar.gz: b46c2bf2f416be1a0270fce972945712f19029d8c65e495a2e6b65404e499e04a8f8c43a04d129de230c2b592a162764b6c4501399ef1dfe6a34703e0e734506
6
+ metadata.gz: d6093f727f48a508aa1914ebf2f2ebc3e88543e5274d17d378697d59a53b42464259820a734fcd6e28142a196a15497ee15c8060f491314116dc606044a32606
7
+ data.tar.gz: 11980d9c6b1790e9de1280a64240ddde3967f0d57b94de5d4e7ab45539fad4f0a852394778ff543cb9437240dc0e8fa55c7b6509281ae25fcdc05b4bdbfb6e7c
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in rake_leiningen.gemspec
data/Gemfile.lock CHANGED
@@ -1,28 +1,29 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_leiningen (0.33.0.pre.2)
4
+ rake_leiningen (0.33.0.pre.5)
5
5
  rake_dependencies (~> 3.1)
6
6
  rake_factory (~> 0.23)
7
- ruby_leiningen (~> 0.21)
7
+ ruby_leiningen (= 0.25.0)
8
8
  semantic (~> 1.6)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (7.0.2.3)
13
+ activesupport (7.0.3.1)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
15
  i18n (>= 1.6, < 2)
16
16
  minitest (>= 5.1)
17
17
  tzinfo (~> 2.0)
18
18
  addressable (2.8.0)
19
19
  public_suffix (>= 2.0.2, < 5.0)
20
+ ast (2.4.2)
20
21
  colored2 (3.1.2)
21
- concurrent-ruby (1.1.9)
22
+ concurrent-ruby (1.1.10)
22
23
  diff-lcs (1.5.0)
23
24
  docile (1.4.0)
24
25
  excon (0.92.0)
25
- fakefs (1.4.1)
26
+ fakefs (1.8.0)
26
27
  faraday (1.10.0)
27
28
  faraday-em_http (~> 1.0)
28
29
  faraday-em_synchrony (~> 1.0)
@@ -49,19 +50,24 @@ GEM
49
50
  gem-release (2.2.2)
50
51
  hamster (3.0.0)
51
52
  concurrent-ruby (~> 1.0)
52
- i18n (1.10.0)
53
+ i18n (1.12.0)
53
54
  concurrent-ruby (~> 1.0)
55
+ json (2.6.2)
54
56
  lino (3.0.0)
55
57
  hamster (~> 3.0)
56
58
  open4 (~> 1.3)
57
59
  minitar (0.9)
58
- minitest (5.15.0)
60
+ minitest (5.16.3)
59
61
  multipart-post (2.1.1)
60
62
  octokit (4.22.0)
61
63
  faraday (>= 0.9)
62
64
  sawyer (~> 0.8.0, >= 0.5.3)
63
65
  open4 (1.3.4)
66
+ parallel (1.22.1)
67
+ parser (3.1.2.1)
68
+ ast (~> 2.4.1)
64
69
  public_suffix (4.0.6)
70
+ rainbow (3.1.1)
65
71
  rake (13.0.6)
66
72
  rake_circle_ci (0.9.0)
67
73
  colored2 (~> 3.1)
@@ -88,6 +94,8 @@ GEM
88
94
  colored2 (~> 3.1)
89
95
  rake_factory (~> 0.23)
90
96
  sshkey (~> 2.0)
97
+ regexp_parser (2.5.0)
98
+ rexml (3.2.5)
91
99
  rspec (3.11.0)
92
100
  rspec-core (~> 3.11.0)
93
101
  rspec-expectations (~> 3.11.0)
@@ -101,10 +109,27 @@ GEM
101
109
  diff-lcs (>= 1.2.0, < 2.0)
102
110
  rspec-support (~> 3.11.0)
103
111
  rspec-support (3.11.0)
112
+ rubocop (1.36.0)
113
+ json (~> 2.3)
114
+ parallel (~> 1.10)
115
+ parser (>= 3.1.2.1)
116
+ rainbow (>= 2.2.2, < 4.0)
117
+ regexp_parser (>= 1.8, < 3.0)
118
+ rexml (>= 3.2.5, < 4.0)
119
+ rubocop-ast (>= 1.20.1, < 2.0)
120
+ ruby-progressbar (~> 1.7)
121
+ unicode-display_width (>= 1.4.0, < 3.0)
122
+ rubocop-ast (1.21.0)
123
+ parser (>= 3.1.1.0)
124
+ rubocop-rake (0.6.0)
125
+ rubocop (~> 1.0)
126
+ rubocop-rspec (2.12.1)
127
+ rubocop (~> 1.31)
128
+ ruby-progressbar (1.11.0)
104
129
  ruby2_keywords (0.0.5)
105
130
  ruby_gpg2 (0.8.0)
106
131
  lino (>= 1.5)
107
- ruby_leiningen (0.24.0.pre.4)
132
+ ruby_leiningen (0.25.0)
108
133
  activesupport (>= 6.0.2, < 8)
109
134
  lino (~> 3.0)
110
135
  rubyzip (2.3.2)
@@ -119,8 +144,9 @@ GEM
119
144
  simplecov-html (0.12.3)
120
145
  simplecov_json_formatter (0.1.4)
121
146
  sshkey (2.0.0)
122
- tzinfo (2.0.4)
147
+ tzinfo (2.0.5)
123
148
  concurrent-ruby (~> 1.0)
149
+ unicode-display_width (2.2.0)
124
150
 
125
151
  PLATFORMS
126
152
  ruby
@@ -139,7 +165,10 @@ DEPENDENCIES
139
165
  rake_leiningen!
140
166
  rake_ssh
141
167
  rspec
168
+ rubocop
169
+ rubocop-rake
170
+ rubocop-rspec
142
171
  simplecov
143
172
 
144
173
  BUNDLED WITH
145
- 2.3.9
174
+ 2.3.22
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
  require 'rake_circle_ci'
3
5
  require 'rake_github'
@@ -5,17 +7,20 @@ require 'rake_ssh'
5
7
  require 'rake_gpg'
6
8
  require 'securerandom'
7
9
  require 'rspec/core/rake_task'
10
+ require 'rubocop/rake_task'
8
11
 
9
- task :default => :spec
10
-
11
- RSpec::Core::RakeTask.new(:spec)
12
+ task default: %i[
13
+ library:fix
14
+ test:unit
15
+ ]
12
16
 
13
17
  namespace :encryption do
14
18
  namespace :passphrase do
19
+ desc 'Generate encryption passphrase for CI GPG key'
15
20
  task :generate do
16
- File.open('config/secrets/ci/encryption.passphrase', 'w') do |f|
17
- f.write(SecureRandom.base64(36))
18
- end
21
+ FileUtils.mkdir_p('config/secrets/ci/')
22
+ File.write('config/secrets/ci/encryption.passphrase',
23
+ SecureRandom.base64(36))
19
24
  end
20
25
  end
21
26
  end
@@ -23,85 +28,102 @@ end
23
28
  namespace :keys do
24
29
  namespace :deploy do
25
30
  RakeSSH.define_key_tasks(
26
- path: 'config/secrets/ci/',
27
- comment: 'maintainers@infrablocks.io')
31
+ path: 'config/secrets/ci/',
32
+ comment: 'maintainers@infrablocks.io'
33
+ )
28
34
  end
29
35
 
30
36
  namespace :gpg do
31
37
  RakeGPG.define_generate_key_task(
32
- output_directory: 'config/secrets/ci',
33
- name_prefix: 'gpg',
34
- owner_name: 'InfraBlocks Maintainers',
35
- owner_email: 'maintainers@infrablocks.io',
36
- owner_comment: 'rake_leiningen CI Key')
38
+ output_directory: 'config/secrets/ci',
39
+ name_prefix: 'gpg',
40
+ owner_name: 'InfraBlocks Maintainers',
41
+ owner_email: 'maintainers@infrablocks.io',
42
+ owner_comment: 'rake_leiningen CI Key'
43
+ )
37
44
  end
38
45
  end
39
46
 
47
+ RuboCop::RakeTask.new
48
+
49
+ namespace :library do
50
+ desc 'Run all checks of the library'
51
+ task check: [:rubocop]
52
+
53
+ desc 'Attempt to automatically fix issues with the library'
54
+ task fix: [:'rubocop:autocorrect']
55
+ end
56
+
57
+ namespace :test do
58
+ RSpec::Core::RakeTask.new(:unit)
59
+ end
60
+
40
61
  RakeCircleCI.define_project_tasks(
41
- namespace: :circle_ci,
42
- project_slug: 'github/infrablocks/rake_leiningen'
62
+ namespace: :circle_ci,
63
+ project_slug: 'github/infrablocks/rake_leiningen'
43
64
  ) do |t|
44
65
  circle_ci_config =
45
- YAML.load_file('config/secrets/circle_ci/config.yaml')
66
+ YAML.load_file('config/secrets/circle_ci/config.yaml')
46
67
 
47
- t.api_token = circle_ci_config["circle_ci_api_token"]
68
+ t.api_token = circle_ci_config['circle_ci_api_token']
48
69
  t.environment_variables = {
49
- ENCRYPTION_PASSPHRASE:
50
- File.read('config/secrets/ci/encryption.passphrase')
51
- .chomp
70
+ ENCRYPTION_PASSPHRASE:
71
+ File.read('config/secrets/ci/encryption.passphrase')
72
+ .chomp
52
73
  }
53
74
  t.checkout_keys = []
54
75
  t.ssh_keys = [
55
- {
56
- hostname: "github.com",
57
- private_key: File.read('config/secrets/ci/ssh.private')
58
- }
76
+ {
77
+ hostname: 'github.com',
78
+ private_key: File.read('config/secrets/ci/ssh.private')
79
+ }
59
80
  ]
60
81
  end
61
82
 
62
83
  RakeGithub.define_repository_tasks(
63
- namespace: :github,
64
- repository: 'infrablocks/rake_leiningen',
84
+ namespace: :github,
85
+ repository: 'infrablocks/rake_leiningen'
65
86
  ) do |t, args|
66
87
  github_config =
67
- YAML.load_file('config/secrets/github/config.yaml')
88
+ YAML.load_file('config/secrets/github/config.yaml')
68
89
 
69
- t.access_token = github_config["github_personal_access_token"]
90
+ t.access_token = github_config['github_personal_access_token']
70
91
  t.deploy_keys = [
71
- {
72
- title: 'CircleCI',
73
- public_key: File.read('config/secrets/ci/ssh.public')
74
- }
92
+ {
93
+ title: 'CircleCI',
94
+ public_key: File.read('config/secrets/ci/ssh.public')
95
+ }
75
96
  ]
76
97
  t.branch_name = args.branch_name
77
98
  t.commit_message = args.commit_message
78
99
  end
79
100
 
80
101
  namespace :pipeline do
81
- task :prepare => [
82
- :'circle_ci:project:follow',
83
- :'circle_ci:env_vars:ensure',
84
- :'circle_ci:checkout_keys:ensure',
85
- :'circle_ci:ssh_keys:ensure',
86
- :'github:deploy_keys:ensure'
102
+ desc 'Prepare CircleCI Pipeline'
103
+ task prepare: %i[
104
+ circle_ci:project:follow
105
+ circle_ci:env_vars:ensure
106
+ circle_ci:checkout_keys:ensure
107
+ circle_ci:ssh_keys:ensure
108
+ github:deploy_keys:ensure
87
109
  ]
88
110
  end
89
111
 
90
112
  namespace :version do
91
- desc "Bump version for specified type (pre, major, minor, patch)"
113
+ desc 'Bump version for specified type (pre, major, minor, patch)'
92
114
  task :bump, [:type] do |_, args|
93
115
  bump_version_for(args.type)
94
116
  end
95
117
  end
96
118
 
97
- desc "Release gem"
119
+ desc 'Release gem'
98
120
  task :release do
99
- sh "gem release --tag --push"
121
+ sh 'gem release --tag --push'
100
122
  end
101
123
 
102
124
  def bump_version_for(version_type)
103
- sh "gem bump --version #{version_type} " +
104
- "&& bundle install " +
105
- "&& export LAST_MESSAGE=\"$(git log -1 --pretty=%B)\" " +
106
- "&& git commit -a --amend -m \"${LAST_MESSAGE} [ci skip]\""
125
+ sh "gem bump --version #{version_type} " \
126
+ '&& bundle install ' \
127
+ '&& export LAST_MESSAGE="$(git log -1 --pretty=%B)" ' \
128
+ '&& git commit -a --amend -m "${LAST_MESSAGE} [ci skip]"'
107
129
  end
data/bin/console CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "rake_leiningen"
4
+ require 'bundler/setup'
5
+ require 'rake_leiningen'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "rake_leiningen"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start(__FILE__)
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory/kernel_extensions'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RakeLeiningen
2
4
  module Mixins
3
5
  module Directoried
@@ -10,4 +12,4 @@ module RakeLeiningen
10
12
  end
11
13
  end
12
14
  end
13
- end
15
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
 
3
5
  require_relative '../tasks/lint'
@@ -20,27 +22,27 @@ module RakeLeiningen
20
22
 
21
23
  parameter :ensure_task_name, default: 'leiningen:ensure'
22
24
 
23
- parameter :lint_task_name, :default => :lint
24
- parameter :optimise_task_name, :default => :optimise
25
- parameter :idiomise_task_name, :default => :idiomise
26
- parameter :format_task_name, :default => :format
27
- parameter :pedantise_task_name, :default => :pedantise
28
- parameter :check_task_name, :default => :check
25
+ parameter :lint_task_name, default: :lint
26
+ parameter :optimise_task_name, default: :optimise
27
+ parameter :idiomise_task_name, default: :idiomise
28
+ parameter :format_task_name, default: :format
29
+ parameter :pedantise_task_name, default: :pedantise
30
+ parameter :check_task_name, default: :check
29
31
 
30
32
  task Tasks::Lint,
31
- name: RakeFactory::DynamicValue.new { |ts| ts.lint_task_name }
33
+ name: RakeFactory::DynamicValue.new { |ts| ts.lint_task_name }
32
34
  task Tasks::Optimise,
33
- name: RakeFactory::DynamicValue.new { |ts| ts.optimise_task_name }
35
+ name: RakeFactory::DynamicValue.new { |ts| ts.optimise_task_name }
34
36
  task Tasks::Idiomise,
35
- name: RakeFactory::DynamicValue.new { |ts| ts.idiomise_task_name },
36
- replace: RakeFactory::DynamicValue.new { |ts| ts.fix }
37
+ name: RakeFactory::DynamicValue.new { |ts| ts.idiomise_task_name },
38
+ replace: RakeFactory::DynamicValue.new { |ts| ts.fix }
37
39
  task Tasks::Format,
38
- name: RakeFactory::DynamicValue.new { |ts| ts.format_task_name },
39
- mode: RakeFactory::DynamicValue.new { |ts| ts.fix ? :fix : :check }
40
+ name: RakeFactory::DynamicValue.new { |ts| ts.format_task_name },
41
+ mode: RakeFactory::DynamicValue.new { |ts| ts.fix ? :fix : :check }
40
42
  task Tasks::Pedantise,
41
- name: RakeFactory::DynamicValue.new { |ts| ts.pedantise_task_name }
43
+ name: RakeFactory::DynamicValue.new { |ts| ts.pedantise_task_name }
42
44
  task Tasks::Check,
43
- name: RakeFactory::DynamicValue.new { |ts| ts.check_task_name }
45
+ name: RakeFactory::DynamicValue.new { |ts| ts.check_task_name }
44
46
  end
45
47
  end
46
48
  end
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'task_sets/checks'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -10,10 +12,10 @@ module RakeLeiningen
10
12
  include Mixins::Directoried
11
13
 
12
14
  default_name :build
13
- default_description "Build standalone uberjar."
14
- default_prerequisites RakeFactory::DynamicValue.new { |t|
15
+ default_description 'Build standalone uberjar.'
16
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
15
17
  t.ensure_task_name ? [t.ensure_task_name] : []
16
- }
18
+ end)
17
19
 
18
20
  parameter :main_namespace
19
21
  parameter :profile
@@ -24,13 +26,14 @@ module RakeLeiningen
24
26
  parameter :ensure_task_name, default: 'leiningen:ensure'
25
27
 
26
28
  action do |t|
27
- puts "Building standalone uberjar..."
29
+ $stdout.puts 'Building standalone uberjar...'
28
30
 
29
31
  in_directory(t.directory) do
30
32
  RubyLeiningen.uberjar(
31
- main_namespace: t.main_namespace,
32
- profile: t.profile,
33
- environment: t.environment)
33
+ main_namespace: t.main_namespace,
34
+ profile: t.profile,
35
+ environment: t.environment
36
+ )
34
37
  end
35
38
  end
36
39
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -10,16 +12,16 @@ module RakeLeiningen
10
12
  include Mixins::Directoried
11
13
 
12
14
  default_name :check
13
- default_description "Perform all checks against clojure files."
14
- default_prerequisites RakeFactory::DynamicValue.new { |t|
15
+ default_description 'Perform all checks against clojure files.'
16
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
15
17
  [
16
- t.lint_task_name,
17
- t.optimise_task_name,
18
- t.idiomise_task_name,
19
- t.format_task_name,
20
- t.pedantise_task_name
18
+ t.lint_task_name,
19
+ t.optimise_task_name,
20
+ t.idiomise_task_name,
21
+ t.format_task_name,
22
+ t.pedantise_task_name
21
23
  ]
22
- }
24
+ end)
23
25
 
24
26
  parameter :lint_task_name, default: :lint
25
27
  parameter :optimise_task_name, default: :optimise
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -10,10 +12,10 @@ module RakeLeiningen
10
12
  include Mixins::Directoried
11
13
 
12
14
  default_name :format
13
- default_description "Format all clojure files."
14
- default_prerequisites RakeFactory::DynamicValue.new { |t|
15
+ default_description 'Format all clojure files.'
16
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
15
17
  t.ensure_task_name ? [t.ensure_task_name] : []
16
- }
18
+ end)
17
19
 
18
20
  parameter :mode
19
21
  parameter :paths
@@ -25,14 +27,15 @@ module RakeLeiningen
25
27
  parameter :ensure_task_name, default: 'leiningen:ensure'
26
28
 
27
29
  action do |t|
28
- puts "Formatting all clojure files..."
30
+ $stdout.puts 'Formatting all clojure files...'
29
31
 
30
32
  in_directory(t.directory) do
31
33
  RubyLeiningen.cljfmt(
32
- mode: t.mode,
33
- paths: t.paths,
34
- profile: t.profile,
35
- environment: t.environment)
34
+ mode: t.mode,
35
+ paths: t.paths,
36
+ profile: t.profile,
37
+ environment: t.environment
38
+ )
36
39
  end
37
40
  end
38
41
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -10,10 +12,10 @@ module RakeLeiningen
10
12
  include Mixins::Directoried
11
13
 
12
14
  default_name :idiomise
13
- default_description "Transform all clojure files to be more idiomatic."
14
- default_prerequisites RakeFactory::DynamicValue.new { |t|
15
+ default_description 'Transform all clojure files to be more idiomatic.'
16
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
15
17
  t.ensure_task_name ? [t.ensure_task_name] : []
16
- }
18
+ end)
17
19
 
18
20
  parameter :replace
19
21
  parameter :interactive
@@ -27,16 +29,17 @@ module RakeLeiningen
27
29
  parameter :ensure_task_name, default: 'leiningen:ensure'
28
30
 
29
31
  action do |t|
30
- puts "Making all clojure files more idiomatic..."
32
+ $stdout.puts 'Making all clojure files more idiomatic...'
31
33
 
32
34
  in_directory(t.directory) do
33
35
  RubyLeiningen.kibit(
34
- replace: t.replace,
35
- interactive: t.interactive,
36
- reporter: t.reporter,
37
- paths: t.paths,
38
- profile: t.profile,
39
- environment: t.environment)
36
+ replace: t.replace,
37
+ interactive: t.interactive,
38
+ reporter: t.reporter,
39
+ paths: t.paths,
40
+ profile: t.profile,
41
+ environment: t.environment
42
+ )
40
43
  end
41
44
  end
42
45
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -10,10 +12,10 @@ module RakeLeiningen
10
12
  include Mixins::Directoried
11
13
 
12
14
  default_name :lint
13
- default_description "Lint all clojure files."
14
- default_prerequisites RakeFactory::DynamicValue.new { |t|
15
+ default_description 'Lint all clojure files.'
16
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
15
17
  t.ensure_task_name ? [t.ensure_task_name] : []
16
- }
18
+ end)
17
19
 
18
20
  parameter :config
19
21
  parameter :profile
@@ -24,13 +26,14 @@ module RakeLeiningen
24
26
  parameter :ensure_task_name, default: 'leiningen:ensure'
25
27
 
26
28
  action do |t|
27
- puts "Linting all clojure files..."
29
+ $stdout.puts 'Linting all clojure files...'
28
30
 
29
31
  in_directory(t.directory) do
30
32
  RubyLeiningen.eastwood(
31
- config: t.config,
32
- profile: t.profile,
33
- environment: t.environment)
33
+ config: t.config,
34
+ profile: t.profile,
35
+ environment: t.environment
36
+ )
34
37
  end
35
38
  end
36
39
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -10,10 +12,10 @@ module RakeLeiningen
10
12
  include Mixins::Directoried
11
13
 
12
14
  default_name :optimise
13
- default_description "Warn on reflection for all clojure files."
14
- default_prerequisites RakeFactory::DynamicValue.new { |t|
15
+ default_description 'Warn on reflection for all clojure files.'
16
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
15
17
  t.ensure_task_name ? [t.ensure_task_name] : []
16
- }
18
+ end)
17
19
 
18
20
  parameter :profile
19
21
  parameter :environment
@@ -23,12 +25,13 @@ module RakeLeiningen
23
25
  parameter :ensure_task_name, default: 'leiningen:ensure'
24
26
 
25
27
  action do |t|
26
- puts "Checking for uses of reflection in all clojure files..."
28
+ $stdout.puts 'Checking for uses of reflection in all clojure files...'
27
29
 
28
30
  in_directory(t.directory) do
29
31
  RubyLeiningen.check(
30
- profile: t.profile,
31
- environment: t.environment)
32
+ profile: t.profile,
33
+ environment: t.environment
34
+ )
32
35
  end
33
36
  end
34
37
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -11,9 +13,9 @@ module RakeLeiningen
11
13
 
12
14
  default_name :pedantise
13
15
  default_description "Hunt for 'bad' code in all clojure files."
14
- default_prerequisites RakeFactory::DynamicValue.new { |t|
16
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
15
17
  t.ensure_task_name ? [t.ensure_task_name] : []
16
- }
18
+ end)
17
19
 
18
20
  parameter :show_help
19
21
  parameter :verbose
@@ -33,22 +35,23 @@ module RakeLeiningen
33
35
  parameter :ensure_task_name, default: 'leiningen:ensure'
34
36
 
35
37
  action do |t|
36
- puts "Looking for 'bad' code in all clojure files..."
38
+ $stdout.puts "Looking for 'bad' code in all clojure files..."
37
39
 
38
40
  in_directory(t.directory) do
39
41
  RubyLeiningen.bikeshed(
40
- show_help: t.show_help,
41
- verbose: t.verbose,
42
- maximum_line_length: t.maximum_line_length,
43
- long_lines: t.long_lines,
44
- trailing_whitespace: t.trailing_whitespace,
45
- trailing_blank_lines: t.trailing_blank_lines,
46
- var_redefs: t.var_redefs,
47
- docstrings: t.docstrings,
48
- name_collisions: t.name_collisions,
49
- exclude_profiles: t.exclude_profiles,
50
- profile: t.profile,
51
- environment: t.environment)
42
+ show_help: t.show_help,
43
+ verbose: t.verbose,
44
+ maximum_line_length: t.maximum_line_length,
45
+ long_lines: t.long_lines,
46
+ trailing_whitespace: t.trailing_whitespace,
47
+ trailing_blank_lines: t.trailing_blank_lines,
48
+ var_redefs: t.var_redefs,
49
+ docstrings: t.docstrings,
50
+ name_collisions: t.name_collisions,
51
+ exclude_profiles: t.exclude_profiles,
52
+ profile: t.profile,
53
+ environment: t.environment
54
+ )
52
55
  end
53
56
  end
54
57
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -10,10 +12,10 @@ module RakeLeiningen
10
12
  include Mixins::Directoried
11
13
 
12
14
  default_name :release
13
- default_description "Release library."
14
- default_prerequisites RakeFactory::DynamicValue.new { |t|
15
+ default_description 'Release library.'
16
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
15
17
  t.ensure_task_name ? [t.ensure_task_name] : []
16
- }
18
+ end)
17
19
 
18
20
  parameter :level
19
21
  parameter :profile
@@ -24,13 +26,14 @@ module RakeLeiningen
24
26
  parameter :ensure_task_name, default: 'leiningen:ensure'
25
27
 
26
28
  action do |t|
27
- puts "Releasing library..."
29
+ $stdout.puts 'Releasing library...'
28
30
 
29
31
  in_directory(t.directory) do
30
32
  RubyLeiningen.release(
31
- level: t.level,
32
- profile: t.profile,
33
- environment: t.environment)
33
+ level: t.level,
34
+ profile: t.profile,
35
+ environment: t.environment
36
+ )
34
37
  end
35
38
  end
36
39
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -10,10 +12,10 @@ module RakeLeiningen
10
12
  include Mixins::Directoried
11
13
 
12
14
  default_name :start
13
- default_description "Run the application."
14
- default_prerequisites RakeFactory::DynamicValue.new { |t|
15
+ default_description 'Run the application.'
16
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
15
17
  t.ensure_task_name ? [t.ensure_task_name] : []
16
- }
18
+ end)
17
19
 
18
20
  parameter :main_function
19
21
  parameter :arguments
@@ -26,15 +28,16 @@ module RakeLeiningen
26
28
  parameter :ensure_task_name, default: 'leiningen:ensure'
27
29
 
28
30
  action do |t|
29
- puts "Running the application..."
31
+ $stdout.puts 'Running the application...'
30
32
 
31
33
  in_directory(t.directory) do
32
34
  RubyLeiningen.run(
33
- main_function: t.main_function,
34
- arguments: t.arguments,
35
- quote_arguments: t.quote_arguments,
36
- profile: t.profile,
37
- environment: t.environment)
35
+ main_function: t.main_function,
36
+ arguments: t.arguments,
37
+ quote_arguments: t.quote_arguments,
38
+ profile: t.profile,
39
+ environment: t.environment
40
+ )
38
41
  end
39
42
  end
40
43
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -10,10 +12,10 @@ module RakeLeiningen
10
12
  include Mixins::Directoried
11
13
 
12
14
  default_name :style
13
- default_description "Make all clojure files conform to a style."
14
- default_prerequisites RakeFactory::DynamicValue.new { |t|
15
+ default_description 'Make all clojure files conform to a style.'
16
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
15
17
  t.ensure_task_name ? [t.ensure_task_name] : []
16
- }
18
+ end)
17
19
 
18
20
  parameter :mode
19
21
  parameter :paths
@@ -23,12 +25,13 @@ module RakeLeiningen
23
25
  parameter :ensure_task_name, default: 'leiningen:ensure'
24
26
 
25
27
  action do |t|
26
- puts "Styling all clojure files..."
28
+ $stdout.puts 'Styling all clojure files...'
27
29
 
28
30
  in_directory(t.directory) do
29
31
  RubyLeiningen.cljstyle(
30
- mode: t.mode,
31
- paths: t.paths)
32
+ mode: t.mode,
33
+ paths: t.paths
34
+ )
32
35
  end
33
36
  end
34
37
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_factory'
2
4
  require 'ruby_leiningen'
3
5
  require 'ruby_leiningen/plugins'
@@ -10,12 +12,12 @@ module RakeLeiningen
10
12
  include Mixins::Directoried
11
13
 
12
14
  default_name :test
13
- default_description RakeFactory::DynamicValue.new { |t|
14
- "Run #{t.type ? "all #{t.type}" : "all"} tests."
15
- }
16
- default_prerequisites RakeFactory::DynamicValue.new { |t|
15
+ default_description(RakeFactory::DynamicValue.new do |t|
16
+ "Run #{t.type ? "all #{t.type}" : 'all'} tests."
17
+ end)
18
+ default_prerequisites(RakeFactory::DynamicValue.new do |t|
17
19
  t.ensure_task_name ? [t.ensure_task_name] : []
18
- }
20
+ end)
19
21
 
20
22
  parameter :type
21
23
 
@@ -31,16 +33,17 @@ module RakeLeiningen
31
33
  parameter :ensure_task_name, default: 'leiningen:ensure'
32
34
 
33
35
  action do |t|
34
- puts "Running #{t.type ? "all #{t.type}" : "all"} tests..."
36
+ $stdout.puts "Running #{t.type ? "all #{t.type}" : 'all'} tests..."
35
37
 
36
38
  in_directory(t.directory) do
37
39
  RubyLeiningen.eftest(
38
- only: t.only,
39
- test_selectors: t.test_selectors,
40
- namespaces: t.namespaces,
41
- files: t.files,
42
- profile: t.profile,
43
- environment: t.environment)
40
+ only: t.only,
41
+ test_selectors: t.test_selectors,
42
+ namespaces: t.namespaces,
43
+ files: t.files,
44
+ profile: t.profile,
45
+ environment: t.environment
46
+ )
44
47
  end
45
48
  end
46
49
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'tasks/lint'
2
4
  require_relative 'tasks/optimise'
3
5
  require_relative 'tasks/idiomise'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RakeLeiningen
2
- VERSION = '0.33.0.pre.2'
4
+ VERSION = '0.33.0.pre.5'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake_dependencies'
2
4
  require 'rake_leiningen/version'
3
5
  require 'rake_leiningen/tasks'
@@ -25,45 +27,87 @@ module RakeLeiningen
25
27
  end
26
28
 
27
29
  def self.define_installation_tasks(opts = {})
28
- namespace = opts[:namespace] || :leiningen
29
- dependency = 'lein'
30
- version = opts[:version] || '2.9.1'
31
- path = opts[:path] || File.join(Dir.pwd, 'vendor', 'leiningen')
32
- type = :uncompressed
33
- uri_template = "https://raw.githubusercontent.com/technomancy/" +
34
- "leiningen/<%= @version %>/bin/lein"
35
- file_name_template = "lein"
36
-
37
- needs_fetch_checker = lambda do |t|
38
- binary = File.join(t.path, t.binary_directory, 'lein')
39
- version_string = StringIO.new
30
+ RubyLeiningen.configure do |c|
31
+ c.binary = leiningen_binary_path(opts)
32
+ end
33
+
34
+ RakeDependencies::TaskSets::All.define(
35
+ installation_task_set_options(opts)
36
+ )
37
+ end
38
+
39
+ class << self
40
+ private
41
+
42
+ def installation_task_set_options(opts)
43
+ {
44
+ namespace: namespace(opts),
45
+ dependency: dependency(opts),
46
+ version: version(opts),
47
+ path: path(opts),
48
+ type: type(opts),
49
+ uri_template: uri_template(opts),
50
+ file_name_template: file_name_template(opts),
51
+ needs_fetch: needs_fetch_check_function(opts)
52
+ }
53
+ end
54
+
55
+ def leiningen_binary_path(opts)
56
+ File.join(path(opts), 'bin', 'lein')
57
+ end
58
+
59
+ def namespace(opts)
60
+ opts[:namespace] || :leiningen
61
+ end
62
+
63
+ def dependency(_)
64
+ 'lein'
65
+ end
40
66
 
41
- if File.exist?(binary)
42
- Lino::CommandLineBuilder.for_command(binary)
43
- .with_flag('-version')
44
- .build
45
- .execute(stdout: version_string)
67
+ def version(opts)
68
+ opts[:version] || '2.9.1'
69
+ end
70
+
71
+ def path(opts)
72
+ opts[:path] || File.join(Dir.pwd, 'vendor', 'leiningen')
73
+ end
74
+
75
+ def type(_)
76
+ :uncompressed
77
+ end
78
+
79
+ def uri_template(_)
80
+ 'https://raw.githubusercontent.com/technomancy/' \
81
+ 'leiningen/<%= @version %>/bin/lein'
82
+ end
83
+
84
+ def file_name_template(_)
85
+ 'lein'
86
+ end
87
+
88
+ def needs_fetch_check_function(opts)
89
+ lambda do |t|
90
+ binary = File.join(t.path, t.binary_directory, 'lein')
46
91
 
47
- if version_string.string.lines.first =~ /#{version}/
92
+ if File.exist?(binary) && get_version(binary) =~ /#{version(opts)}/
48
93
  return false
49
94
  end
50
- end
51
95
 
52
- return true
96
+ return true
97
+ end
53
98
  end
54
99
 
55
- RubyLeiningen.configure do |c|
56
- c.binary = File.join(path, 'bin', 'lein')
100
+ def get_version(binary)
101
+ version_string = StringIO.new
102
+ version_command(binary).execute(stdout: version_string)
103
+ version_string.string.lines.first
57
104
  end
58
105
 
59
- RakeDependencies::TaskSets::All.define(
60
- namespace: namespace,
61
- dependency: dependency,
62
- version: version,
63
- path: path,
64
- type: type,
65
- uri_template: uri_template,
66
- file_name_template: file_name_template,
67
- needs_fetch: needs_fetch_checker)
106
+ def version_command(binary)
107
+ Lino::CommandLineBuilder
108
+ .for_command(binary)
109
+ .with_flag('-version')
110
+ .build
111
+ end
68
112
  end
69
113
  end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'rake_leiningen/version'
6
+
7
+ files = %w[
8
+ bin
9
+ lib
10
+ CODE_OF_CONDUCT.md
11
+ rake_leiningen.gemspec
12
+ Gemfile
13
+ LICENSE.txt
14
+ Rakefile
15
+ README.md
16
+ ]
17
+
18
+ Gem::Specification.new do |spec|
19
+ spec.name = 'rake_leiningen'
20
+ spec.version = RakeLeiningen::VERSION
21
+ spec.authors = ['InfraBlocks Maintainers']
22
+ spec.email = ['maintainers@infrablocks.io']
23
+
24
+ spec.summary = 'Rake tasks for interoperating with a leiningen project.'
25
+ spec.description = 'Rake tasks for common leiningen commands allowing ' \
26
+ 'a leiningen project to be managed as part of a build.'
27
+ spec.homepage = 'https://github.com/infrablocks/rake_leiningen'
28
+ spec.license = 'MIT'
29
+
30
+ spec.files = `git ls-files -z`.split("\x0").select do |f|
31
+ f.match(/^(#{files.map { |g| Regexp.escape(g) }.join('|')})/)
32
+ end
33
+ spec.bindir = 'exe'
34
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
+ spec.require_paths = ['lib']
36
+
37
+ spec.required_ruby_version = '>= 2.7'
38
+
39
+ spec.add_dependency 'rake_dependencies', '~> 3.1'
40
+ spec.add_dependency 'rake_factory', '~> 0.23'
41
+ spec.add_dependency 'ruby_leiningen', '0.25.0'
42
+ spec.add_dependency 'semantic', '~> 1.6'
43
+
44
+ spec.add_development_dependency 'activesupport'
45
+ spec.add_development_dependency 'bundler'
46
+ spec.add_development_dependency 'fakefs'
47
+ spec.add_development_dependency 'gem-release'
48
+ spec.add_development_dependency 'rake'
49
+ spec.add_development_dependency 'rake_circle_ci'
50
+ spec.add_development_dependency 'rake_github'
51
+ spec.add_development_dependency 'rake_gpg'
52
+ spec.add_development_dependency 'rake_ssh'
53
+ spec.add_development_dependency 'rspec'
54
+ spec.add_development_dependency 'rubocop'
55
+ spec.add_development_dependency 'rubocop-rake'
56
+ spec.add_development_dependency 'rubocop-rspec'
57
+ spec.add_development_dependency 'simplecov'
58
+
59
+ spec.metadata['rubygems_mfa_required'] = 'false'
60
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_leiningen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.0.pre.2
4
+ version: 0.33.0.pre.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-21 00:00:00.000000000 Z
11
+ date: 2022-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake_dependencies
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: ruby_leiningen
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '0.21'
47
+ version: 0.25.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '0.21'
54
+ version: 0.25.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: semantic
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.6'
69
+ - !ruby/object:Gem::Dependency
70
+ name: activesupport
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: bundler
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +94,34 @@ dependencies:
80
94
  - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: fakefs
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: gem-release
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
83
125
  - !ruby/object:Gem::Dependency
84
126
  name: rake
85
127
  requirement: !ruby/object:Gem::Requirement
@@ -123,7 +165,7 @@ dependencies:
123
165
  - !ruby/object:Gem::Version
124
166
  version: '0'
125
167
  - !ruby/object:Gem::Dependency
126
- name: rake_ssh
168
+ name: rake_gpg
127
169
  requirement: !ruby/object:Gem::Requirement
128
170
  requirements:
129
171
  - - ">="
@@ -137,7 +179,7 @@ dependencies:
137
179
  - !ruby/object:Gem::Version
138
180
  version: '0'
139
181
  - !ruby/object:Gem::Dependency
140
- name: rake_gpg
182
+ name: rake_ssh
141
183
  requirement: !ruby/object:Gem::Requirement
142
184
  requirements:
143
185
  - - ">="
@@ -165,7 +207,7 @@ dependencies:
165
207
  - !ruby/object:Gem::Version
166
208
  version: '0'
167
209
  - !ruby/object:Gem::Dependency
168
- name: gem-release
210
+ name: rubocop
169
211
  requirement: !ruby/object:Gem::Requirement
170
212
  requirements:
171
213
  - - ">="
@@ -179,7 +221,7 @@ dependencies:
179
221
  - !ruby/object:Gem::Version
180
222
  version: '0'
181
223
  - !ruby/object:Gem::Dependency
182
- name: activesupport
224
+ name: rubocop-rake
183
225
  requirement: !ruby/object:Gem::Requirement
184
226
  requirements:
185
227
  - - ">="
@@ -193,7 +235,7 @@ dependencies:
193
235
  - !ruby/object:Gem::Version
194
236
  version: '0'
195
237
  - !ruby/object:Gem::Dependency
196
- name: fakefs
238
+ name: rubocop-rspec
197
239
  requirement: !ruby/object:Gem::Requirement
198
240
  requirements:
199
241
  - - ">="
@@ -254,10 +296,12 @@ files:
254
296
  - lib/rake_leiningen/tasks/style.rb
255
297
  - lib/rake_leiningen/tasks/test.rb
256
298
  - lib/rake_leiningen/version.rb
299
+ - rake_leiningen.gemspec
257
300
  homepage: https://github.com/infrablocks/rake_leiningen
258
301
  licenses:
259
302
  - MIT
260
- metadata: {}
303
+ metadata:
304
+ rubygems_mfa_required: 'false'
261
305
  post_install_message:
262
306
  rdoc_options: []
263
307
  require_paths: