nutrella 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +15 -3
- data/lib/nutrella/command.rb +17 -1
- data/lib/nutrella/configuration.rb +7 -5
- data/lib/nutrella/string_ext.rb +1 -5
- data/lib/nutrella/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '048802727749f75d0574ca96e6049f9a50e9e07593f0f9be6bb1dd2b3960691e'
|
4
|
+
data.tar.gz: c7e3409c81c7eca40460f827a649f18ab8246bd98759eaf57a29ff4ffd1c4f97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b1edcfb213175f8360135e326166f235782be1351bed8c7d1b27e4ee45abf2f693ed6fa56554adcec711c3efb1057a022b60e893dac4911ca27c1a1f27ca1d0
|
7
|
+
data.tar.gz: c83f869b34a624f5e39b16408e07a6afc7a1c69c575c6f454b37570c1da4bab6892bfef5f09fbab1f83e77295aef07a82aa50edffcd4b23daa36e4472926b9a8
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.5.2] - 2020-04-27
|
10
|
+
|
11
|
+
#### New Features
|
12
|
+
|
13
|
+
- Added a configuration option to enable logging for easier troubleshooting
|
14
|
+
|
9
15
|
## [1.5.1] - 2020-04-27
|
10
16
|
|
11
17
|
#### Bug Fix
|
data/README.md
CHANGED
@@ -75,6 +75,12 @@ To open your Trello board in the Trello app change your configuration to:
|
|
75
75
|
enable_trello_app: true
|
76
76
|
```
|
77
77
|
|
78
|
+
Adjust the `enable_logging` configuration to start logging diagnostics:
|
79
|
+
|
80
|
+
```yaml
|
81
|
+
enable_logging: true
|
82
|
+
```
|
83
|
+
|
78
84
|
|
79
85
|
## Usage
|
80
86
|
|
@@ -95,7 +101,13 @@ Note: you can invoke `nutrella` from your project directory or from any subdirec
|
|
95
101
|
|
96
102
|
## Troubleshooting
|
97
103
|
|
98
|
-
1.
|
104
|
+
1. If an unexpected Trello board is opening try clearing your cache:
|
105
|
+
|
106
|
+
```sh
|
107
|
+
rm ~/.nutrella.cache.yml
|
108
|
+
```
|
109
|
+
|
110
|
+
1. If you see `method_missing: undefined method 'this'`
|
99
111
|
|
100
112
|
Try updating `RubyGems`
|
101
113
|
|
@@ -103,7 +115,7 @@ Note: you can invoke `nutrella` from your project directory or from any subdirec
|
|
103
115
|
gem update --system
|
104
116
|
```
|
105
117
|
|
106
|
-
1.
|
118
|
+
1. If you see `uninitialized constant Gem::Source (NameError)`
|
107
119
|
|
108
120
|
Try updating `bundler`
|
109
121
|
|
@@ -111,7 +123,7 @@ Note: you can invoke `nutrella` from your project directory or from any subdirec
|
|
111
123
|
gem install bundler
|
112
124
|
```
|
113
125
|
|
114
|
-
1.
|
126
|
+
1. If you see `cannot load such file -- nutrella`
|
115
127
|
|
116
128
|
This error may appear after running `irb -rubygems` and you are unable to `require 'nutrella'`.
|
117
129
|
Try running `irb -rubygems` from your home directory:
|
data/lib/nutrella/command.rb
CHANGED
@@ -15,6 +15,8 @@ module Nutrella
|
|
15
15
|
|
16
16
|
def run
|
17
17
|
launch(board_url)
|
18
|
+
ensure
|
19
|
+
logger.close
|
18
20
|
end
|
19
21
|
|
20
22
|
private
|
@@ -22,11 +24,17 @@ module Nutrella
|
|
22
24
|
def launch(url)
|
23
25
|
launch_command = configuration_values.fetch(:launch_command).gsub("$url$", url)
|
24
26
|
|
27
|
+
logger.info { "Launch command: '#{launch_command}'" }
|
28
|
+
|
25
29
|
system(launch_command)
|
26
30
|
end
|
27
31
|
|
28
32
|
def board_url
|
29
|
-
enable_trello_app? ? trello_url(cached_url) : cached_url
|
33
|
+
url = enable_trello_app? ? trello_url(cached_url) : cached_url
|
34
|
+
|
35
|
+
logger.info { "Board URL: '#{url}'" }
|
36
|
+
|
37
|
+
url
|
30
38
|
end
|
31
39
|
|
32
40
|
def cached_url
|
@@ -41,6 +49,14 @@ module Nutrella
|
|
41
49
|
configuration_values.fetch(:enable_trello_app)
|
42
50
|
end
|
43
51
|
|
52
|
+
def logger
|
53
|
+
@_logger ||= Logger.new(log_filename)
|
54
|
+
end
|
55
|
+
|
56
|
+
def log_filename
|
57
|
+
configuration_values.fetch(:enable_logging) ? "nutrella.log" : "/dev/null"
|
58
|
+
end
|
59
|
+
|
44
60
|
def trello_url(http_url)
|
45
61
|
http_url.gsub(/^http.?:/, "trello:")
|
46
62
|
end
|
@@ -9,7 +9,7 @@ module Nutrella
|
|
9
9
|
class Configuration
|
10
10
|
NULOGY_ORGANIZATION_ID = "542d76ac2fad4697c3e80448"
|
11
11
|
|
12
|
-
INITIAL_CONFIGURATION =
|
12
|
+
INITIAL_CONFIGURATION = <<~YAML
|
13
13
|
# Trello Developer API Keys
|
14
14
|
key: <your developer key>
|
15
15
|
secret: <your developer secret>
|
@@ -18,7 +18,8 @@ module Nutrella
|
|
18
18
|
# Optional Configuration
|
19
19
|
organization: #{NULOGY_ORGANIZATION_ID}
|
20
20
|
launch_command: open $url$
|
21
|
-
enable_trello_app:
|
21
|
+
enable_trello_app: false
|
22
|
+
enable_logging: false
|
22
23
|
YAML
|
23
24
|
|
24
25
|
attr_reader :path, :values
|
@@ -35,14 +36,15 @@ module Nutrella
|
|
35
36
|
|
36
37
|
private
|
37
38
|
|
38
|
-
def load_configuration
|
39
|
+
def load_configuration # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
39
40
|
@values = {
|
40
41
|
key: configuration.fetch("key"),
|
41
42
|
secret: configuration.fetch("secret"),
|
42
43
|
token: configuration.fetch("token"),
|
43
44
|
organization: configuration.fetch("organization", NULOGY_ORGANIZATION_ID),
|
44
45
|
launch_command: configuration.fetch("launch_command", "open $url$"),
|
45
|
-
enable_trello_app: configuration.fetch("enable_trello_app", "
|
46
|
+
enable_trello_app: configuration.fetch("enable_trello_app", "false"),
|
47
|
+
enable_logging: configuration.fetch("enable_logging", "false")
|
46
48
|
}
|
47
49
|
rescue => e
|
48
50
|
abort "#{path} #{e}"
|
@@ -64,7 +66,7 @@ module Nutrella
|
|
64
66
|
end
|
65
67
|
|
66
68
|
def configuration_missing_message
|
67
|
-
|
69
|
+
<<~TEXT
|
68
70
|
I see that you don't have a config file '#{path}'.
|
69
71
|
So, I created one for you.
|
70
72
|
|
data/lib/nutrella/string_ext.rb
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Simpler versions of
|
3
|
+
# Simpler versions of an extension from ActiveSupport.
|
4
4
|
#
|
5
5
|
class String
|
6
|
-
def strip_heredoc
|
7
|
-
gsub(/^ +/, "")
|
8
|
-
end
|
9
|
-
|
10
6
|
def titleize
|
11
7
|
tr("_-", " ").split(" ").map(&:capitalize).join(" ")
|
12
8
|
end
|
data/lib/nutrella/version.rb
CHANGED
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.5.
|
4
|
+
version: 1.5.2
|
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-04-
|
11
|
+
date: 2020-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-trello
|