trello_freestyler 0.3.0 → 0.4.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 +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/lib/trello_freestyler/main.rb +12 -14
- data/lib/trello_freestyler/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: 4954ed0ff60fcddd08c3446685dfc8d24581f36c5798c05435fb7f78bf9d7900
|
4
|
+
data.tar.gz: 95f212985ea8a2c0ab5fef1fc5dbc97823c9b4fa1aa4f75f30a7a25dbd0db2ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cc6511d911141862caf2a815154103efe2097dd41eef726204031f003ca001c2088b51ba8d6d346b72af29133b3c81800194754f79630a7c6354f8b4a07b7f5
|
7
|
+
data.tar.gz: c264e485ff0a1e186086cb7a636bc6a48a56e6cdac19c938543b3a3bd00244e9422bf96395ca1bb37b272eb121bde35f1b168947d24c2502536f4b01f65bd97a
|
data/CHANGELOG.md
CHANGED
@@ -2,4 +2,8 @@
|
|
2
2
|
## Version 0.3.0
|
3
3
|
|
4
4
|
- moved `TrelloFreestyler::Cli::Options` to `TrelloFreestyler::Options`
|
5
|
-
- added instructions on how to use without the cli
|
5
|
+
- added instructions on how to use without the cli
|
6
|
+
|
7
|
+
## Version 0.4.0
|
8
|
+
|
9
|
+
- add `execution_datetime` and `execution_local_date` field to each row of the data we export.
|
data/Gemfile.lock
CHANGED
@@ -13,6 +13,8 @@ module TrelloFreestyler
|
|
13
13
|
# rubocop:disable Metrics/AbcSize
|
14
14
|
def self.dump(options)
|
15
15
|
client = TrelloFreestyler::Client.new(options.key, options.token, options.url)
|
16
|
+
execution_datetime = Time.now.getlocal(options.timezone.current_period.offset.utc_total_offset)
|
17
|
+
execution_date = Date.parse(execution_datetime.strftime('%Y/%m/%d')).to_s
|
16
18
|
|
17
19
|
response_cards = client.cards(options.board_id)
|
18
20
|
card_dump = parse_cards(response_cards.body)
|
@@ -26,26 +28,18 @@ module TrelloFreestyler
|
|
26
28
|
end.flatten
|
27
29
|
)
|
28
30
|
|
29
|
-
basename = init_output_basename(options.output,
|
30
|
-
|
31
|
-
|
31
|
+
basename = init_output_basename(options.output, execution_date)
|
32
|
+
export_with_stamp(card_dump.raw, basename.join('cards.jsonl').to_s, execution_datetime, execution_date)
|
33
|
+
export_with_stamp(actions_dump.raw, basename.join('actions.jsonl').to_s, execution_datetime, execution_date)
|
32
34
|
end
|
33
35
|
# rubocop:enable Metrics/AbcSize
|
34
36
|
|
35
|
-
def self.init_output_basename(base,
|
36
|
-
time = Time.now.getlocal(timezone.current_period.offset.utc_total_offset)
|
37
|
-
date = Date.parse(time.strftime('%Y/%m/%d')).to_s
|
37
|
+
def self.init_output_basename(base, date)
|
38
38
|
base = Pathname.new(base).join(date)
|
39
39
|
Pathname.new(base).mkpath
|
40
40
|
base
|
41
41
|
end
|
42
42
|
|
43
|
-
def self.full_filename(base, filename, timezone)
|
44
|
-
time = Time.now.getlocal(timezone.current_period.offset.utc_total_offset)
|
45
|
-
date = Date.parse(time.strftime('%Y/%m/%d')).to_s
|
46
|
-
Pathname.new(base).join(date).join(filename).to_s
|
47
|
-
end
|
48
|
-
|
49
43
|
def self.parse_cards(raw_text)
|
50
44
|
cards = JSON.parse(raw_text)
|
51
45
|
cards.each_with_object(Struct::CardDump.new([], [])) do |card, all|
|
@@ -63,9 +57,13 @@ module TrelloFreestyler
|
|
63
57
|
end
|
64
58
|
end
|
65
59
|
|
66
|
-
def self.
|
60
|
+
def self.export_with_stamp(dump, to, execution_datetime, execution_date)
|
67
61
|
File.open(to, 'w') do |f|
|
68
|
-
dump.each
|
62
|
+
dump.each do |row|
|
63
|
+
row[:execution_datetime] = execution_datetime
|
64
|
+
row[:execution_local_date] = execution_date
|
65
|
+
f.puts row.to_json
|
66
|
+
end
|
69
67
|
end
|
70
68
|
end
|
71
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trello_freestyler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Hamman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|