ptimelog 0.10.0 → 0.12.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/AGENTS.md +42 -0
- data/PLAN-ADD-COMMAND.md +140 -0
- data/README.md +81 -13
- data/exe/ptimelog +26 -2
- data/lib/ptimelog/command/add.rb +30 -27
- data/lib/ptimelog/command/confirm.rb +82 -0
- data/lib/ptimelog/command/edit.rb +47 -7
- data/lib/ptimelog/command/info.rb +48 -0
- data/lib/ptimelog/command/show.rb +44 -27
- data/lib/ptimelog/command/upload.rb +49 -18
- data/lib/ptimelog/configuration.rb +13 -6
- data/lib/ptimelog/data_source.rb +43 -0
- data/lib/ptimelog/day.rb +7 -32
- data/lib/ptimelog/entry.rb +84 -22
- data/lib/ptimelog/error.rb +7 -0
- data/lib/ptimelog/joiner.rb +47 -0
- data/lib/ptimelog/named_date.rb +1 -1
- data/lib/ptimelog/operon.rb +170 -0
- data/lib/ptimelog/script.rb +1 -1
- data/lib/ptimelog/timelog.rb +56 -3
- data/lib/ptimelog/version.rb +9 -1
- data/lib/ptimelog.rb +14 -3
- data/opencode.json +37 -0
- metadata +136 -47
- data/.envrc +0 -1
- data/.gitignore +0 -10
- data/.overcommit.yml +0 -26
- data/.rspec +0 -2
- data/.rubocop.yml +0 -42
- data/.rubocop_todo.yml +0 -16
- data/.ruby-version +0 -1
- data/.tool-versions +0 -1
- data/.travis.yml +0 -7
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/lib/ptimelog/app.rb +0 -21
- data/lib/ptimelog/command/base.rb +0 -29
- data/lib/ptimelog/command/version.rb +0 -16
- data/ptimelog.gemspec +0 -40
data/.overcommit.yml
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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/brigade/overcommit/blob/master/config/default.yml
|
|
4
|
-
#
|
|
5
|
-
# For a complete list of hooks, see:
|
|
6
|
-
# https://github.com/brigade/overcommit/tree/master/lib/overcommit/hook
|
|
7
|
-
#
|
|
8
|
-
# For a complete list of options that you can use to customize hooks, see:
|
|
9
|
-
# https://github.com/brigade/overcommit#configuration
|
|
10
|
-
|
|
11
|
-
PreCommit:
|
|
12
|
-
RuboCop:
|
|
13
|
-
enabled: true
|
|
14
|
-
on_warn: fail # Treat all warnings as failures
|
|
15
|
-
|
|
16
|
-
TrailingWhitespace:
|
|
17
|
-
enabled: true
|
|
18
|
-
# exclude:
|
|
19
|
-
# - '**/db/structure.sql' # Ignore trailing whitespace in generated files
|
|
20
|
-
|
|
21
|
-
#PostCheckout:
|
|
22
|
-
# ALL: # Special hook name that customizes all hooks of this type
|
|
23
|
-
# quiet: true # Change all post-checkout hooks to only display output on failure
|
|
24
|
-
#
|
|
25
|
-
# IndexTags:
|
|
26
|
-
# enabled: true # Generate a tags file with `ctags` each time HEAD changes
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
|
2
|
-
|
|
3
|
-
# require:
|
|
4
|
-
# - rubocop-rake
|
|
5
|
-
# - rubocop-rspec
|
|
6
|
-
# - rubocop-packaging
|
|
7
|
-
# - rubocop-performance
|
|
8
|
-
|
|
9
|
-
AllCops:
|
|
10
|
-
NewCops: enable
|
|
11
|
-
|
|
12
|
-
Layout/LineLength:
|
|
13
|
-
Max: 120
|
|
14
|
-
|
|
15
|
-
Metrics/BlockLength:
|
|
16
|
-
Exclude:
|
|
17
|
-
- spec/**/*
|
|
18
|
-
|
|
19
|
-
Style/TrailingCommaInArrayLiteral:
|
|
20
|
-
EnforcedStyleForMultiline: consistent_comma
|
|
21
|
-
|
|
22
|
-
Style/TrailingCommaInHashLiteral:
|
|
23
|
-
EnforcedStyleForMultiline: consistent_comma
|
|
24
|
-
|
|
25
|
-
Layout/HashAlignment:
|
|
26
|
-
EnforcedHashRocketStyle: table
|
|
27
|
-
EnforcedColonStyle: table
|
|
28
|
-
EnforcedLastArgumentHashStyle: always_inspect # default
|
|
29
|
-
|
|
30
|
-
Naming/MethodParameterName:
|
|
31
|
-
AllowedNames:
|
|
32
|
-
- fn
|
|
33
|
-
# default allowed names
|
|
34
|
-
- io
|
|
35
|
-
- id
|
|
36
|
-
- to
|
|
37
|
-
- by
|
|
38
|
-
- on
|
|
39
|
-
- in
|
|
40
|
-
- at
|
|
41
|
-
- ip
|
|
42
|
-
- db
|
data/.rubocop_todo.yml
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# This configuration was generated by
|
|
2
|
-
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2020-01-22 14:10:50 +0100 using RuboCop version 0.79.0.
|
|
4
|
-
# The point is for the user to remove these configuration records
|
|
5
|
-
# one by one as the offenses are removed from the code base.
|
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
-
|
|
9
|
-
# Offense count: 4
|
|
10
|
-
Metrics/AbcSize:
|
|
11
|
-
Max: 16
|
|
12
|
-
|
|
13
|
-
# Offense count: 5
|
|
14
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
|
15
|
-
Metrics/MethodLength:
|
|
16
|
-
Max: 15
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.7.0
|
data/.tool-versions
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ruby 2.7.2
|
data/.travis.yml
DELETED
data/bin/console
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require 'bundler/setup'
|
|
5
|
-
require 'ptimelog'
|
|
6
|
-
|
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
-
|
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
-
# require "pry"
|
|
12
|
-
# Pry.start
|
|
13
|
-
|
|
14
|
-
require 'irb'
|
|
15
|
-
IRB.start
|
data/bin/setup
DELETED
data/lib/ptimelog/app.rb
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Ptimelog
|
|
4
|
-
# Wrapper for everything, dispatching to a command
|
|
5
|
-
class App
|
|
6
|
-
def initialize(args)
|
|
7
|
-
@config = Configuration.instance
|
|
8
|
-
command = (args[0] || 'show')
|
|
9
|
-
|
|
10
|
-
constant_name = command.to_s[0].upcase + command[1..].downcase
|
|
11
|
-
command_class = Command.const_get(constant_name.to_sym)
|
|
12
|
-
raise ArgumentError, "Unsupported Command '#{command}'" if command_class.nil?
|
|
13
|
-
|
|
14
|
-
@command = command_class.new(args[1]) # e.g. Ptimelog::Command::Show.new('today')
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def run
|
|
18
|
-
@command.run
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Ptimelog
|
|
4
|
-
module Command
|
|
5
|
-
# Foundation and common API for all commands
|
|
6
|
-
class Base
|
|
7
|
-
def initialize(day = nil)
|
|
8
|
-
@config = Configuration.instance
|
|
9
|
-
|
|
10
|
-
return unless needs_entries?
|
|
11
|
-
|
|
12
|
-
@entries = {}
|
|
13
|
-
self.entries = Ptimelog::Day.new(day).entries
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def needs_entries?
|
|
17
|
-
false
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def run
|
|
21
|
-
raise 'Implement a run-method for your command'
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def entries=(_values)
|
|
25
|
-
raise 'Implement a entries-writer-method for your command' if needs_entries?
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
data/ptimelog.gemspec
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
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 'ptimelog/version'
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |spec|
|
|
8
|
-
spec.name = 'ptimelog'
|
|
9
|
-
spec.version = Ptimelog::VERSION
|
|
10
|
-
spec.authors = ['Matthias Viehweger']
|
|
11
|
-
spec.email = ['kronn@kronn.de']
|
|
12
|
-
|
|
13
|
-
spec.summary = 'Move time-entries from gTimelog to PuzzleTime'
|
|
14
|
-
# spec.description = %q{}
|
|
15
|
-
spec.homepage = 'https://github.com/kronn/ptimelog'
|
|
16
|
-
spec.license = 'MIT'
|
|
17
|
-
|
|
18
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
19
|
-
f.match(%r{(gpuzzletime|^(test|spec|features)/)})
|
|
20
|
-
end
|
|
21
|
-
spec.bindir = 'exe'
|
|
22
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
23
|
-
spec.require_paths = ['lib']
|
|
24
|
-
|
|
25
|
-
spec.required_ruby_version = '>= 2.7.0'
|
|
26
|
-
|
|
27
|
-
spec.add_dependency 'naught'
|
|
28
|
-
|
|
29
|
-
spec.add_development_dependency 'bundler'
|
|
30
|
-
spec.add_development_dependency 'overcommit', '~> 0.45'
|
|
31
|
-
spec.add_development_dependency 'pry', '~> 0.12'
|
|
32
|
-
spec.add_development_dependency 'rake', '>= 12.3.3'
|
|
33
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
34
|
-
spec.add_development_dependency 'rubocop', '~> 0.50'
|
|
35
|
-
# spec.add_development_dependency 'rubocop-rake'
|
|
36
|
-
# spec.add_development_dependency 'rubocop-rspec'
|
|
37
|
-
# spec.add_development_dependency 'rubocop-packaging'
|
|
38
|
-
# spec.add_development_dependency 'rubocop-performance'
|
|
39
|
-
spec.add_development_dependency 'timecop', '~> 0.9'
|
|
40
|
-
end
|