libledger 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 21d2a5e653fea800acff701648c477dc42862403
4
- data.tar.gz: 9648f9b22ff52900763a1b24fab12c6c2d178bd3
2
+ SHA256:
3
+ metadata.gz: 31458f8ab63fbe1940222139b9a2474150ca0ac79be18746fd68a801ef17e5ac
4
+ data.tar.gz: 6c34e5ed15172465dfd670acef6c8e5c079f6788f77b23aa37fe392bd6d22cab
5
5
  SHA512:
6
- metadata.gz: 2bfcf8b26f193afab0340892d76834dfb59b04c58d6030c501ee5528a6cdcf69b5f2826998f0e52a4f90b12d6b2671cf733632ac0d95c2618f92942ef2c68311
7
- data.tar.gz: d41846d4e84a973901532c2b20b7f9b40e04fc0bc61006504f77f011e86ffd80bce8553dc89d3437a0e7910378de4fbd8c9c0aea472c283a0fdc3613595ebf74
6
+ metadata.gz: 65c2797d60c32e93acde1156f81e4a0a63dbc6558b34071929782683b4ebc2debb79181c3b4b885314aa8dadd4ee434a168704adf211e7ec42ae576fc87e5453
7
+ data.tar.gz: e687d59357e18a68f2e2ab754fca2e1e6b3fc108a820b4c3c533ed869036eba426ac0f1bac3452bc75e3db606564838ee2d4efe03c314ff8f29a2dfcb4a34c25
data/.circle-ruby CHANGED
@@ -1,4 +1,4 @@
1
- 2.4.0
2
- 2.3.3
3
- 2.2.6
4
- 2.1.10
1
+ 2.5.1
2
+ 2.4.4
3
+ 2.3.7
4
+ 2.2.10
data/.prospectus CHANGED
@@ -1,11 +1,11 @@
1
+ my_slug = 'akerl/libledger'
2
+
3
+ Prospectus.extra_dep('file', 'prospectus_circleci')
4
+ Prospectus.extra_dep('file', 'prospectus_gems')
5
+
1
6
  item do
2
- expected do
3
- static
4
- set 'green'
5
- end
7
+ noop
6
8
 
7
- actual do
8
- gemnasium
9
- slug 'akerl/libledger'
10
- end
9
+ extend ProspectusGems::Gemspec.new
10
+ extend ProspectusCircleci::Build.new(my_slug)
11
11
  end
data/.rubocop.yml CHANGED
@@ -1,2 +1,2 @@
1
- Encoding:
2
- Enabled: false
1
+ inherit_gem:
2
+ goodcop: .rubocop.yml
data/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
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']
11
10
  task.fail_on_error = true
12
11
  end
13
12
 
14
- task default: [:spec, :rubocop, :build, :install]
13
+ task default: %i[spec rubocop build install]
@@ -20,15 +20,17 @@ module Ledger
20
20
  end
21
21
 
22
22
  def from_file(file)
23
- entries = read_file_chunks(file).map { |x| Entry.from_lines(x) }
24
- Journal.new(entries: entries)
23
+ from_text(File.read(file))
24
+ end
25
+
26
+ def from_text(text)
27
+ Journal.new(entries: text_to_entries(text))
25
28
  end
26
29
 
27
30
  private
28
31
 
29
- def read_file_chunks(file)
30
- chunks = File.read(file).split("\n").chunk_while { |_, x| x =~ /^\s/ }
31
- chunks.select { |x| x.size > 1 }
32
+ def text_to_entries(text)
33
+ text.split("\n\n").map { |x| Entry.from_lines(x.split("\n")) }
32
34
  end
33
35
  end
34
36
  end
data/libledger.gemspec CHANGED
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'libledger'
3
- s.version = '0.0.3'
3
+ s.version = '0.0.4'
4
4
  s.date = Time.now.strftime('%Y-%m-%d')
5
5
 
6
6
  s.summary = 'Library for interacting with Ledger files'
7
- s.description = "Library for interacting with Ledger files"
7
+ s.description = 'Library for interacting with Ledger files'
8
8
  s.authors = ['Les Aker']
9
9
  s.email = 'me@lesaker.org'
10
10
  s.homepage = 'https://github.com/akerl/libledger'
@@ -13,9 +13,10 @@ Gem::Specification.new do |s|
13
13
  s.files = `git ls-files`.split
14
14
  s.test_files = `git ls-files spec/*`.split
15
15
 
16
- s.add_development_dependency 'rubocop', '~> 0.47.0'
17
- s.add_development_dependency 'rake', '~> 12.0.0'
18
16
  s.add_development_dependency 'codecov', '~> 0.1.1'
19
- s.add_development_dependency 'rspec', '~> 3.5.0'
20
- s.add_development_dependency 'fuubar', '~> 2.2.0'
17
+ s.add_development_dependency 'fuubar', '~> 2.3.0'
18
+ s.add_development_dependency 'goodcop', '~> 0.5.0'
19
+ s.add_development_dependency 'rake', '~> 12.3.0'
20
+ s.add_development_dependency 'rspec', '~> 3.7.0'
21
+ s.add_development_dependency 'rubocop', '~> 0.56.0'
21
22
  end
metadata CHANGED
@@ -1,85 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libledger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-18 00:00:00.000000000 Z
11
+ date: 2018-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rubocop
14
+ name: codecov
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.47.0
19
+ version: 0.1.1
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.47.0
26
+ version: 0.1.1
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: fuubar
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 12.0.0
33
+ version: 2.3.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 12.0.0
40
+ version: 2.3.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: codecov
42
+ name: goodcop
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.1
47
+ version: 0.5.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.1
54
+ version: 0.5.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 12.3.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 12.3.0
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: 3.5.0
75
+ version: 3.7.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: 3.5.0
82
+ version: 3.7.0
69
83
  - !ruby/object:Gem::Dependency
70
- name: fuubar
84
+ name: rubocop
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: 2.2.0
89
+ version: 0.56.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: 2.2.0
96
+ version: 0.56.0
83
97
  description: Library for interacting with Ledger files
84
98
  email: me@lesaker.org
85
99
  executables: []
@@ -122,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
136
  version: '0'
123
137
  requirements: []
124
138
  rubyforge_project:
125
- rubygems_version: 2.6.8
139
+ rubygems_version: 2.7.6
126
140
  signing_key:
127
141
  specification_version: 4
128
142
  summary: Library for interacting with Ledger files