ballista 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circle-ruby +4 -0
- data/.prospectus +8 -8
- data/.rubocop.yml +2 -2
- data/.travis.yml +10 -0
- data/Gemfile +0 -1
- data/README.md +1 -2
- data/Rakefile +1 -2
- data/ballista.gemspec +9 -7
- data/bin/ballista +1 -1
- data/lib/ballista.rb +1 -0
- data/lib/ballista/frequencies.rb +18 -0
- data/lib/ballista/frequencies/base.rb +21 -0
- data/lib/ballista/frequencies/biweekly.rb +11 -0
- data/lib/ballista/frequencies/monthly.rb +27 -0
- data/lib/ballista/frequencies/weekly.rb +23 -0
- data/lib/ballista/version.rb +1 -1
- metadata +42 -23
- data/circle.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c74f019cd5c212356a42b5a7697b748bd988def4873ab99500524e61d9de8b8b
|
4
|
+
data.tar.gz: 9bd98f2cfb303b2978016a15a2476fa281269d237f018e71a79eb7c968f45149
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f70e7dc1751028e0bfd2874ea6cabf861427ee61cab59cf453adb2f5fd0b9cc53329a79b38718c1cbfb3c52ac2d4773440f5dbfc4270e4d6705fb2527e5d59c7
|
7
|
+
data.tar.gz: 6dd125358119055315c358338a927ea0944db24587ac7d4705ce78442204b024a64c9418acaca2fbc0aa90681a760a0125a8a108cb3279d2e1b8b8230385ad75
|
data/.circle-ruby
ADDED
data/.prospectus
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
+
my_slug = 'akerl/ballista'
|
2
|
+
|
3
|
+
Prospectus.extra_dep('file', 'prospectus_travis')
|
4
|
+
Prospectus.extra_dep('file', 'prospectus_gems')
|
5
|
+
|
1
6
|
item do
|
2
|
-
|
3
|
-
static
|
4
|
-
set 'green'
|
5
|
-
end
|
7
|
+
noop
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
slug 'akerl/ballista'
|
10
|
-
end
|
9
|
+
extend ProspectusGems::Gemspec.new
|
10
|
+
extend ProspectusTravis::Build.new(my_slug)
|
11
11
|
end
|
data/.rubocop.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
inherit_gem:
|
2
|
+
goodcop: .rubocop.yml
|
data/.travis.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
dist: xenial
|
2
|
+
install:
|
3
|
+
- for i in $(cat .circle-ruby) ; do rvm install $i || exit 1 ; done
|
4
|
+
- for i in $(cat .circle-ruby) ; do rvm-exec $i bundle install || exit 1 ; done
|
5
|
+
script:
|
6
|
+
- for i in $(cat .circle-ruby) ; do rvm-exec $i bundle exec rake || exit 1 ; done
|
7
|
+
notifications:
|
8
|
+
email: false
|
9
|
+
slack:
|
10
|
+
secure: BrYLyxYCfTN/nK4VrKkXh9HxqIu2Vtz1L4TbW8AtHPsCxOMj650yuwmZncgq06DYQWW8v1Sch/KcXTTmOJvN4ebW3oVRfLCPzBzheHij5EPLkAo8uR8703iHZfJtGLGsx7Dc7x2Ohgtv+aHtK89RHp0ZR9hIUwC6Z3PJP6W0u9N/p3Cq4sum+QnANIhW/wjJt9koTGRp80NN6e70siB64OrpzOGCIm1cLBa9m2Oqc0pM/NcBI6IFYFAlbJmOHnvm1/QS8KVW361soUbVGBEr0FtlNNcy4k0bY5TUiciSe2kAM/F72uumumkvztNEKZpYibP/7UxoTGzyX2GEysJJxkDnmquUh01Uzfc0VbAA7bnkL/YmXHLMu/u3Vqq2DbjymFPyYSFtjznw05SXQNVcqJ7IGkb1//5XiEc5YH8g5qjU7ma7eZdZe7Rd81gZ8ePIzrjXhq+7lX3pLY/GpLMcJs2XQlHTatSZ5BjBZcpEjfBTVb7uD5G/6afKXm5l+6M8uB16zMjnxtFfi/11mLLjScaE9h4SiCtiAG0E58pHlbBbrmBkqlxc7PmXTS5wGIg6qRzsU9SrJeKSPv8UnN7bcndA9JdoCKTRDELremtbPDpehAkaX5mi/5Uw+/FQ4Qx19S+WToMMRaGcvzzyDf13twKIgrZMTBvJHw1Qyhiu7Gk=
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,7 @@ ballista
|
|
2
2
|
=========
|
3
3
|
|
4
4
|
[![Gem Version](https://img.shields.io/gem/v/ballista.svg)](https://rubygems.org/gems/ballista)
|
5
|
-
[![
|
6
|
-
[![Build Status](https://img.shields.io/circleci/project/akerl/ballista.svg)](https://circleci.com/gh/akerl/ballista)
|
5
|
+
[![Build Status](https://img.shields.io/travis/com/akerl/ballista.svg)](https://travis-ci.com/akerl/ballista)
|
7
6
|
[![Coverage Status](https://img.shields.io/codecov/c/github/akerl/ballista.svg)](https://codecov.io/github/akerl/ballista)
|
8
7
|
[![Code Quality](https://img.shields.io/codacy/c9caebd934f04ca699d1f02fac6dcf22.svg)](https://www.codacy.com/app/akerl/ballista)
|
9
8
|
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
|
data/Rakefile
CHANGED
@@ -7,8 +7,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
7
7
|
|
8
8
|
desc 'Run Rubocop on the gem'
|
9
9
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
10
|
-
task.patterns = ['lib/**/*.rb', 'spec/**/*.rb', 'bin/*']
|
11
10
|
task.fail_on_error = true
|
12
11
|
end
|
13
12
|
|
14
|
-
task default: [
|
13
|
+
task default: %i[spec rubocop build install]
|
data/ballista.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
require 'English'
|
2
|
+
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
|
2
3
|
require 'ballista/version'
|
3
4
|
|
4
5
|
Gem::Specification.new do |s|
|
@@ -7,7 +8,7 @@ Gem::Specification.new do |s|
|
|
7
8
|
s.date = Time.now.strftime('%Y-%m-%d')
|
8
9
|
|
9
10
|
s.summary = 'Projection tool for Ledger format'
|
10
|
-
s.description =
|
11
|
+
s.description = 'Projection tool for Ledger format'
|
11
12
|
s.authors = ['Les Aker']
|
12
13
|
s.email = 'me@lesaker.org'
|
13
14
|
s.homepage = 'https://github.com/akerl/ballista'
|
@@ -17,13 +18,14 @@ Gem::Specification.new do |s|
|
|
17
18
|
s.test_files = `git ls-files spec/*`.split
|
18
19
|
s.executables = ['ballista']
|
19
20
|
|
21
|
+
s.add_dependency 'cymbal', '~> 2.0.0'
|
20
22
|
s.add_dependency 'libledger', '~> 0.0.1'
|
21
23
|
s.add_dependency 'mercenary', '~> 0.3.4'
|
22
|
-
s.add_dependency 'cymbal', '~> 1.0.0'
|
23
24
|
|
24
|
-
s.add_development_dependency 'rubocop', '~> 0.39.0'
|
25
|
-
s.add_development_dependency 'rake', '~> 11.1.0'
|
26
25
|
s.add_development_dependency 'codecov', '~> 0.1.1'
|
27
|
-
s.add_development_dependency '
|
28
|
-
s.add_development_dependency '
|
26
|
+
s.add_development_dependency 'fuubar', '~> 2.3.0'
|
27
|
+
s.add_development_dependency 'goodcop', '~> 0.7.0'
|
28
|
+
s.add_development_dependency 'rake', '~> 12.3.0'
|
29
|
+
s.add_development_dependency 'rspec', '~> 3.8.0'
|
30
|
+
s.add_development_dependency 'rubocop', '~> 0.67.2'
|
29
31
|
end
|
data/bin/ballista
CHANGED
data/lib/ballista.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'ballista/frequencies/base'
|
2
|
+
require 'ballista/frequencies/monthly'
|
3
|
+
require 'ballista/frequencies/weekly'
|
4
|
+
require 'ballista/frequencies/biweekly'
|
5
|
+
|
6
|
+
module Ballista
|
7
|
+
##
|
8
|
+
# Base module for Frequency of actions
|
9
|
+
module Frequencies
|
10
|
+
class << self
|
11
|
+
FREQUENCIES = {
|
12
|
+
monthly: Monthly,
|
13
|
+
weekly: Weekly,
|
14
|
+
biweekly: Biweekly
|
15
|
+
}.freeze
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Ballista
|
4
|
+
module Frequencies
|
5
|
+
##
|
6
|
+
# Base class for frequency subclasses
|
7
|
+
class Base
|
8
|
+
def initialize(action, start, stop)
|
9
|
+
@name = action[:name]
|
10
|
+
@start = action[:starts] ? Date.parse(action[:starts]) : start
|
11
|
+
@stop = action[:stops] ? Date.parse(action[:stops]) : stop
|
12
|
+
@amount = action[:amount].to_i
|
13
|
+
@when = action[:when]
|
14
|
+
end
|
15
|
+
|
16
|
+
def entry(date)
|
17
|
+
[date, @name, @amount]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Ballista
|
2
|
+
module Frequencies
|
3
|
+
##
|
4
|
+
# Monthly actions
|
5
|
+
class Monthly < Base
|
6
|
+
def initialize(*_)
|
7
|
+
super
|
8
|
+
@when = [@when] unless @when.is_a? Array
|
9
|
+
end
|
10
|
+
|
11
|
+
def log
|
12
|
+
@when.flat_map do |date|
|
13
|
+
pointer = Date.new(Date.today.year, 1, date)
|
14
|
+
get_dates([], pointer, 0)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_dates(log, pointer, counter)
|
19
|
+
date = pointer >> counter
|
20
|
+
return log if date > @stop
|
21
|
+
return get_dates(log, pointer, counter + 1) if date < @start
|
22
|
+
log << entry(date)
|
23
|
+
get_dates(log, pointer, counter + 1)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Ballista
|
2
|
+
module Frequencies
|
3
|
+
##
|
4
|
+
# Weekly actions
|
5
|
+
class Weekly < Base
|
6
|
+
def log
|
7
|
+
pointer = Date.parse(@when)
|
8
|
+
get_dates([], pointer)
|
9
|
+
end
|
10
|
+
|
11
|
+
def get_dates(log, pointer)
|
12
|
+
return log if pointer > @stop
|
13
|
+
return get_dates(log, pointer + step) if pointer < @start
|
14
|
+
log << entry(pointer)
|
15
|
+
get_dates(log, pointer + step)
|
16
|
+
end
|
17
|
+
|
18
|
+
def step
|
19
|
+
7
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/ballista/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ballista
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cymbal
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: libledger
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,89 +53,89 @@ dependencies:
|
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: 0.3.4
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
56
|
+
name: codecov
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
48
|
-
type: :
|
61
|
+
version: 0.1.1
|
62
|
+
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
68
|
+
version: 0.1.1
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: fuubar
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 2.3.0
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
82
|
+
version: 2.3.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
84
|
+
name: goodcop
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
89
|
+
version: 0.7.0
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
96
|
+
version: 0.7.0
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: rake
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 12.3.0
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 12.3.0
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rspec
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: 3.
|
117
|
+
version: 3.8.0
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: 3.
|
124
|
+
version: 3.8.0
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
126
|
+
name: rubocop
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
131
|
+
version: 0.67.2
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
138
|
+
version: 0.67.2
|
125
139
|
description: Projection tool for Ledger format
|
126
140
|
email: me@lesaker.org
|
127
141
|
executables:
|
@@ -129,18 +143,24 @@ executables:
|
|
129
143
|
extensions: []
|
130
144
|
extra_rdoc_files: []
|
131
145
|
files:
|
146
|
+
- ".circle-ruby"
|
132
147
|
- ".gitignore"
|
133
148
|
- ".prospectus"
|
134
149
|
- ".rspec"
|
135
150
|
- ".rubocop.yml"
|
151
|
+
- ".travis.yml"
|
136
152
|
- Gemfile
|
137
153
|
- LICENSE
|
138
154
|
- README.md
|
139
155
|
- Rakefile
|
140
156
|
- ballista.gemspec
|
141
157
|
- bin/ballista
|
142
|
-
- circle.yml
|
143
158
|
- lib/ballista.rb
|
159
|
+
- lib/ballista/frequencies.rb
|
160
|
+
- lib/ballista/frequencies/base.rb
|
161
|
+
- lib/ballista/frequencies/biweekly.rb
|
162
|
+
- lib/ballista/frequencies/monthly.rb
|
163
|
+
- lib/ballista/frequencies/weekly.rb
|
144
164
|
- lib/ballista/projection.rb
|
145
165
|
- lib/ballista/version.rb
|
146
166
|
- spec/ballista_spec.rb
|
@@ -164,8 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
184
|
- !ruby/object:Gem::Version
|
165
185
|
version: '0'
|
166
186
|
requirements: []
|
167
|
-
|
168
|
-
rubygems_version: 2.5.1
|
187
|
+
rubygems_version: 3.0.1
|
169
188
|
signing_key:
|
170
189
|
specification_version: 4
|
171
190
|
summary: Projection tool for Ledger format
|
data/circle.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
dependencies:
|
2
|
-
override:
|
3
|
-
- 'rvm-exec 1.9.3-p551 bundle install'
|
4
|
-
- 'rvm-exec 2.0.0-p645 bundle install'
|
5
|
-
- 'rvm-exec 2.1.6 bundle install'
|
6
|
-
- 'rvm-exec 2.2.2 bundle install'
|
7
|
-
test:
|
8
|
-
override:
|
9
|
-
- 'rvm-exec 1.9.3-p551 bundle exec rake'
|
10
|
-
- 'rvm-exec 2.0.0-p645 bundle exec rake'
|
11
|
-
- 'rvm-exec 2.1.6 bundle exec rake'
|
12
|
-
- 'rvm-exec 2.2.2 bundle exec rake'
|