checkoff 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.overcommit.yml +33 -0
- data/README.md +2 -0
- data/checkoff.gemspec +1 -0
- data/coverage/.last_run.json +1 -1
- data/lib/checkoff/config_loader.rb +43 -3
- data/lib/checkoff/projects.rb +2 -2
- data/lib/checkoff/tasks.rb +1 -1
- data/lib/checkoff/version.rb +1 -1
- data/lib/checkoff/workspaces.rb +2 -2
- data/metrics/bigfiles_high_water_mark +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4602a0a2276fa337153e3394f009fa99a8a22603003baf9e99fb9da65c9b9107
|
4
|
+
data.tar.gz: e1a006d0debc96dbf11fd5e63d4930446bf35a3ae7f261bbbfca79a9d9bbad02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c998ad14b388dd17a118536b1abacd2e2dc0195fd42f847090c142cb17636f9bd8fe17e2ee4202d2784d7d907ea6aad59381639a5fa71af32babd70bd229229
|
7
|
+
data.tar.gz: b47bb6ce0899ad62c683fefb67596cc5ca371dc0b67d1cacec881060c19d2cb796175b781530231d2cb320b7662dd4929b5a6eac21b8ae9accfd1c138d344d10
|
data/.overcommit.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Use this file to configure the Overcommit hooks you wish to use. This will
|
2
|
+
# extend the default configuration defined in:
|
3
|
+
# https://github.com/sds/overcommit/blob/master/config/default.yml
|
4
|
+
#
|
5
|
+
# At the topmost level of this YAML file is a key representing type of hook
|
6
|
+
# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
|
7
|
+
# customize each hook, such as whether to only run it on certain files (via
|
8
|
+
# `include`), whether to only display output if it fails (via `quiet`), etc.
|
9
|
+
#
|
10
|
+
# For a complete list of hooks, see:
|
11
|
+
# https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
|
12
|
+
#
|
13
|
+
# For a complete list of options that you can use to customize hooks, see:
|
14
|
+
# https://github.com/sds/overcommit#configuration
|
15
|
+
#
|
16
|
+
# Uncomment the following lines to make the configuration take effect.
|
17
|
+
|
18
|
+
PreCommit:
|
19
|
+
RuboCop:
|
20
|
+
enabled: true
|
21
|
+
on_warn: fail # Treat all warnings as failures
|
22
|
+
#
|
23
|
+
# TrailingWhitespace:
|
24
|
+
# enabled: true
|
25
|
+
# exclude:
|
26
|
+
# - '**/db/structure.sql' # Ignore trailing whitespace in generated files
|
27
|
+
#
|
28
|
+
#PostCheckout:
|
29
|
+
# ALL: # Special hook name that customizes all hooks of this type
|
30
|
+
# quiet: true # Change all post-checkout hooks to only display output on failure
|
31
|
+
#
|
32
|
+
# IndexTags:
|
33
|
+
# enabled: true # Generate a tags file with `ctags` each time HEAD changes
|
data/README.md
CHANGED
data/checkoff.gemspec
CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency 'bundler'
|
31
31
|
spec.add_development_dependency 'minitest-profile'
|
32
32
|
spec.add_development_dependency 'mocha'
|
33
|
+
spec.add_development_dependency 'overcommit'
|
33
34
|
spec.add_development_dependency 'quality', '~> 38'
|
34
35
|
spec.add_development_dependency 'rake', '~> 13.0'
|
35
36
|
spec.add_development_dependency 'rspec', '>=3.4'
|
data/coverage/.last_run.json
CHANGED
@@ -4,12 +4,52 @@ require 'yaml'
|
|
4
4
|
require 'active_support/core_ext/hash'
|
5
5
|
|
6
6
|
module Checkoff
|
7
|
+
# Use the provided config from a YAML file, and fall back to env
|
8
|
+
# variable if it's not populated for a key'
|
9
|
+
class EnvFallbackConfigLoader
|
10
|
+
def initialize(config, sym, yaml_filename)
|
11
|
+
@config = config
|
12
|
+
@envvar_prefix = sym.upcase
|
13
|
+
@yaml_filename = yaml_filename
|
14
|
+
end
|
15
|
+
|
16
|
+
def envvar_name(key)
|
17
|
+
"#{@envvar_prefix}__#{key.upcase}"
|
18
|
+
end
|
19
|
+
|
20
|
+
def [](key)
|
21
|
+
config_value = @config[key]
|
22
|
+
return config_value unless config_value.nil?
|
23
|
+
|
24
|
+
ENV[envvar_name(key)]
|
25
|
+
end
|
26
|
+
|
27
|
+
def fetch(key)
|
28
|
+
out = self[key]
|
29
|
+
return out unless out.nil?
|
30
|
+
|
31
|
+
raise KeyError,
|
32
|
+
"Please configure either the #{key} key in #{@yaml_filename} or set #{envvar_name(key)}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
7
36
|
# Load configuration file
|
8
37
|
class ConfigLoader
|
9
|
-
def self.
|
38
|
+
def self.yaml_filename(sym)
|
10
39
|
file = "#{sym}.yml"
|
11
|
-
|
12
|
-
|
40
|
+
File.expand_path("~/.#{file}")
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.load_yaml_file(sym)
|
44
|
+
filename = yaml_filename(sym)
|
45
|
+
return {} unless File.exist?(filename)
|
46
|
+
|
47
|
+
YAML.load_file(filename).with_indifferent_access
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.load(sym)
|
51
|
+
yaml_result = load_yaml_file(sym)
|
52
|
+
EnvFallbackConfigLoader.new(yaml_result, sym, yaml_filename(sym))
|
13
53
|
end
|
14
54
|
end
|
15
55
|
end
|
data/lib/checkoff/projects.rb
CHANGED
@@ -49,8 +49,8 @@ module Checkoff
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def my_tasks(workspace_name)
|
52
|
-
my_tasks = @config
|
53
|
-
gid =
|
52
|
+
my_tasks = @config.fetch(:my_tasks)
|
53
|
+
gid = my_tasks[workspace_name] unless my_tasks.nil?
|
54
54
|
raise "Please define [:my_tasks][#{workspace_name}] in config file" if my_tasks.nil? || gid.nil?
|
55
55
|
|
56
56
|
projects.find_by_id(gid)
|
data/lib/checkoff/tasks.rb
CHANGED
data/lib/checkoff/version.rb
CHANGED
data/lib/checkoff/workspaces.rb
CHANGED
@@ -11,13 +11,13 @@ module Checkoff
|
|
11
11
|
|
12
12
|
def client
|
13
13
|
@client ||= @asana_client.new do |c|
|
14
|
-
c.authentication :access_token, @config
|
14
|
+
c.authentication :access_token, @config.fetch(:personal_access_token)
|
15
15
|
c.default_headers 'asana-enable' => 'string_ids,new_sections'
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
def default_workspace_gid
|
20
|
-
@config
|
20
|
+
@config.fetch(:default_workspace_gid)
|
21
21
|
end
|
22
22
|
|
23
23
|
def workspace_by_name(workspace_name)
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
416
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checkoff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vince Broz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: overcommit
|
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'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: quality
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,6 +188,7 @@ extra_rdoc_files: []
|
|
174
188
|
files:
|
175
189
|
- ".circleci/config.yml"
|
176
190
|
- ".gitignore"
|
191
|
+
- ".overcommit.yml"
|
177
192
|
- ".rubocop.yml"
|
178
193
|
- ".ruby-version"
|
179
194
|
- ".travis.yml"
|