nutrella 1.4.0 → 1.5.0

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: 3a6d83b25cd95d98651ae81097264d6e1e5d6cb24cc0d51ef3d3a197774a0cd3
4
- data.tar.gz: a66e05e57cf86ec91bb98bb7f2ef6aacc6ecac079f26eeb7b2571b3d220c827d
3
+ metadata.gz: 3ada2f552730cbf6221835584e054c6e11e97772d0a31ea615b82216555d4b09
4
+ data.tar.gz: 199bdf1116434ed92d25c718fa8aee98e96c998427176508a55b81acf59bee01
5
5
  SHA512:
6
- metadata.gz: b4b3760610a3d564af84f9414dbba812f00807e3f370a9cdada7cfe67d6d8e3a17d95c105d3fb40a2da7d88e65aed4f0c90abf45846d8cfec16ac4a66830231d
7
- data.tar.gz: 0e3e14772d78f495fa650e6ab8d7a01e4234a0d5f10a90b3a368ed1dd0068251be63c2689f072c2846269aaadfcb8977e9f800d75d7f9eec0e1063960d75a78d
6
+ metadata.gz: 9d4bf1688c192e4a6b0f669d610931ec99c1ff95c9147b09e8a88e66933e8f53957cca69040cbd9462f867d6084bea00beb787e27f22fec8da227a18186ee8db
7
+ data.tar.gz: f57b83dfb937e477a8f56d71bda8a6b3414252bab313d6c1f1c501b3d504ce691a99f5f4b0db3f2c4b7708bf96a87127ab6d53a6462c386f13cfea763f889731
@@ -1,5 +1,4 @@
1
1
  require:
2
- - rubocop-performance
3
2
  - rubocop-rspec
4
3
 
5
4
  AllCops:
@@ -12,9 +11,21 @@ AllCops:
12
11
  Layout/MultilineMethodCallBraceLayout:
13
12
  Enabled: false
14
13
 
14
+ Layout/SpaceAroundMethodCallOperator:
15
+ Enabled: true
16
+
17
+ Lint/RaiseException:
18
+ Enabled: true
19
+
20
+ Lint/StructNewOverride:
21
+ Enabled: true
22
+
15
23
  Metrics/BlockLength:
16
24
  Enabled: false
17
25
 
26
+ Naming/MemoizedInstanceVariableName:
27
+ EnforcedStyleForLeadingUnderscores: required
28
+
18
29
  RSpec/AnyInstance:
19
30
  Enabled: false
20
31
 
@@ -45,6 +56,15 @@ RSpec/MultipleExpectations:
45
56
  RSpec/SubjectStub:
46
57
  Enabled: false
47
58
 
59
+ Style/BlockDelimiters:
60
+ Enabled: true
61
+ EnforcedStyle: line_count_based
62
+ BracesRequiredMethods:
63
+ - 'let'
64
+
65
+ Style/ExponentialNotation:
66
+ Enabled: true
67
+
48
68
  # We can ignore this small performance improvement.
49
69
  Style/FrozenStringLiteralComment:
50
70
  Enabled: false
@@ -1 +1 @@
1
- 2.5.3
1
+ 2.6.6
@@ -6,16 +6,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.5.0] - 2020-04-26
10
+
11
+ #### New Features
12
+
13
+ - Added a configuration option to support opening boards in the desktop Trello app
14
+
9
15
  ## [1.4.0] - 2020-03-30
16
+
17
+ #### Breaking Changes
18
+
10
19
  - Drop support for Ruby 2.4
11
20
 
12
21
  ## [1.3.1] - 2019-05-20
13
- ### Added
22
+
23
+ #### New Features
24
+
14
25
  - Added a configuration option to adjust the command that launches your Trello boards
15
26
 
16
27
  ## [1.3.0] - 2019-05-20
17
- ### Yanked
28
+
29
+ #### Yanked
18
30
 
19
31
  ## [1.2.2] - 2019-04-27
20
- ### Added
32
+
21
33
  - Added a changelog
data/README.md CHANGED
@@ -47,6 +47,7 @@ If your haven't already done so, insert your `key`, `secret`, and `token` into y
47
47
 
48
48
  The configuration file should look like the following (don't use the keys below, they won't work):
49
49
 
50
+ ```yaml
50
51
  # Trello Developer API Keys
51
52
  key: c2fc703429da08b6e7dcb0a878e35564
52
53
  secret: 7fd865f372891afa93aabdb6b836254bcda10c8a320def2b3207e2ffb425bc0a
@@ -55,50 +56,69 @@ The configuration file should look like the following (don't use the keys below,
55
56
  # Optional Configuration
56
57
  organization: 542d76ac2fad4697c3e80448
57
58
  launch_command: open $url$
59
+ enable_trello_app: false
60
+ ```
61
+
62
+ Finally, you can tweak your configuration:
58
63
 
59
- Finally, you can adjust the launch_command to fit your needs. For example, on macOS to open your
60
- Trello board in Firefox change the last line to:
64
+ 1. Adjust the launch_command configuration to fit your needs. For example, on macOS to open
65
+ your Trello board in Firefox change your configuration to:
61
66
 
67
+ ```yaml
62
68
  launch_command: open -a firefox $url$
69
+ ```
70
+
71
+ 1. Adjust the enable_trello_app configuration to open boards in the Trello app. For example,
72
+ if you have installed the Trello app on macOS to open your Trello board in the Trello app
73
+ change your configuration to:
63
74
 
75
+ ```yaml
76
+ enable_trello_app: true
77
+ ```
64
78
 
65
79
  ## Usage
66
80
 
67
81
  Create or open a Trello board based on the name of the current git branch:
68
82
 
83
+ ```sh
69
84
  $ nutrella
85
+ ```
70
86
 
71
87
  Create or open a named Trello board:
72
88
 
89
+ ```sh
73
90
  $ nutrella <git-branch-name>
91
+ ```
74
92
 
75
93
  Note: you can invoke `nutrella` from your project directory or from any subdirectory.
76
94
 
95
+
77
96
  ## Troubleshooting
78
97
 
79
- #### `method_missing: undefined method 'this'`
98
+ 1. For `method_missing: undefined method 'this'`
80
99
 
81
- Try updating `RubyGems`
100
+ Try updating `RubyGems`
82
101
 
83
- ```sh
84
- gem update --system
85
- ```
102
+ ```sh
103
+ gem update --system
104
+ ```
86
105
 
87
- #### `uninitialized constant Gem::Source (NameError)`
106
+ 1. For `uninitialized constant Gem::Source (NameError)`
88
107
 
89
- Try updating `bundler`
108
+ Try updating `bundler`
90
109
 
91
- ```sh
92
- gem install bundler
93
- ```
110
+ ```sh
111
+ gem install bundler
112
+ ```
94
113
 
95
- #### `cannot load such file -- nutrella`
114
+ 1. For `cannot load such file -- nutrella`
96
115
 
97
- This error may appear after running `irb -rubygems` and you are unable to `require 'nutrella'`. Try running `irb -rubygems` from your home directory:
116
+ This error may appear after running `irb -rubygems` and you are unable to `require 'nutrella'`.
117
+ Try running `irb -rubygems` from your home directory:
98
118
 
99
- ```sh
100
- cd ~
101
- ```
119
+ ```sh
120
+ cd ~
121
+ ```
102
122
 
103
123
 
104
124
  ## Origin of Name
@@ -41,7 +41,7 @@ module Nutrella
41
41
  end
42
42
 
43
43
  def cache_contents
44
- @cache_contents ||= YAML.load_file(path)
44
+ @_cache_contents ||= YAML.load_file(path)
45
45
  end
46
46
  end
47
47
  end
@@ -14,23 +14,35 @@ module Nutrella
14
14
  end
15
15
 
16
16
  def run
17
- open board_url # rubocop:disable Security/Open
17
+ launch(board_url)
18
18
  end
19
19
 
20
20
  private
21
21
 
22
+ def launch(url)
23
+ launch_command = configuration_values.fetch(:launch_command).gsub("$url$", url)
24
+
25
+ system(launch_command)
26
+ end
27
+
22
28
  def board_url
23
- url_cache.fetch(@board_name) { task_board.lookup_or_create(@board_name).url }
29
+ enable_trello_app? ? trello_url(cached_url) : cached_url
30
+ end
31
+
32
+ def cached_url
33
+ @_cached_url ||= url_cache.fetch(@board_name) { task_board.lookup_or_create(@board_name).url }
24
34
  end
25
35
 
26
36
  def configuration_values
27
- @configuration_values ||= Nutrella::Configuration.values(configuration_filename)
37
+ @_configuration_values ||= Nutrella::Configuration.values(configuration_filename)
28
38
  end
29
39
 
30
- def open(url)
31
- launch_command = configuration_values.fetch(:launch_command).gsub("$url$", url)
40
+ def enable_trello_app?
41
+ configuration_values.fetch(:enable_trello_app)
42
+ end
32
43
 
33
- system(launch_command)
44
+ def trello_url(http_url)
45
+ http_url.gsub(/^http.?:/, "trello:")
34
46
  end
35
47
 
36
48
  def task_board
@@ -18,6 +18,7 @@ module Nutrella
18
18
  # Optional Configuration
19
19
  organization: #{NULOGY_ORGANIZATION_ID}
20
20
  launch_command: open $url$
21
+ enable_trello_app: False
21
22
  YAML
22
23
 
23
24
  attr_reader :path, :values
@@ -35,19 +36,22 @@ module Nutrella
35
36
  private
36
37
 
37
38
  def load_configuration
38
- configuration = YAML.load_file(path)
39
-
40
39
  @values = {
41
40
  key: configuration.fetch("key"),
42
41
  secret: configuration.fetch("secret"),
43
42
  token: configuration.fetch("token"),
44
43
  organization: configuration.fetch("organization", NULOGY_ORGANIZATION_ID),
45
- launch_command: configuration.fetch("launch_command", "open $url$")
44
+ launch_command: configuration.fetch("launch_command", "open $url$"),
45
+ enable_trello_app: configuration.fetch("enable_trello_app", "False")
46
46
  }
47
47
  rescue => e
48
48
  abort "#{path} #{e}"
49
49
  end
50
50
 
51
+ def configuration
52
+ @_configuration ||= YAML.load_file(path)
53
+ end
54
+
51
55
  def configuration_missing?
52
56
  return false if File.exist?(path)
53
57
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nutrella
4
- VERSION = "1.4.0"
4
+ VERSION = "1.5.0"
5
5
  end
@@ -30,8 +30,7 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_development_dependency "rake", ">= 12.1", "< 13.1"
32
32
  spec.add_development_dependency "rspec", ">= 3.9", "< 4.0"
33
- spec.add_development_dependency "rubocop", "~> 0.80"
34
- spec.add_development_dependency "rubocop-performance", "~> 1.5"
33
+ spec.add_development_dependency "rubocop", "~> 0.82"
35
34
  spec.add_development_dependency "rubocop-rspec", "~> 1.38"
36
35
  spec.add_development_dependency "simplecov", "~> 0.17"
37
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutrella
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alistair McKinnell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-30 00:00:00.000000000 Z
11
+ date: 2020-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-trello
@@ -70,28 +70,14 @@ dependencies:
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '0.80'
73
+ version: '0.82'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '0.80'
81
- - !ruby/object:Gem::Dependency
82
- name: rubocop-performance
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - "~>"
86
- - !ruby/object:Gem::Version
87
- version: '1.5'
88
- type: :development
89
- prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - "~>"
93
- - !ruby/object:Gem::Version
94
- version: '1.5'
80
+ version: '0.82'
95
81
  - !ruby/object:Gem::Dependency
96
82
  name: rubocop-rspec
97
83
  requirement: !ruby/object:Gem::Requirement
@@ -182,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
168
  - !ruby/object:Gem::Version
183
169
  version: '0'
184
170
  requirements: []
185
- rubygems_version: 3.1.2
171
+ rubygems_version: 3.0.3
186
172
  signing_key:
187
173
  specification_version: 4
188
174
  summary: A command line tool for creating a Trello Board based on the current git