everything-core 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6930e135f667b27803ee6f3880cf9065930dcc0
4
- data.tar.gz: 034652cb0f67c43b269b6c0f7a1ad95bf1de2c2a
3
+ metadata.gz: e66db03bfad6a1e58a7aeff49d6798ada6b0964d
4
+ data.tar.gz: ea00f472f7f0a9c2cb845e657f229e6d0bc96c43
5
5
  SHA512:
6
- metadata.gz: 03971f08b4f32d3fd7c5d3dc34d0b262024ea8bdd07b7cf0e1f7b81ddea4d08d9c6e34b777d668fd4d095e6ccdc09b156f0bebed3509b8cb89c37b557cf806c7
7
- data.tar.gz: cccbd47e5994d8f396893021845d88a55f0751bdc3fe15da507095e1dc8f7be85fe21c80117be42d4499b11690368dd69def8df43e74a4fa6395ef5433bec6f8
6
+ metadata.gz: a24df55089664a1af6ad6a84a2610915ec8d2c32102d63ca16a6d9bc0740452fe2c215897ed6c9451a1882e0f227635117ecd232d4da624709bc7c7e322f2248
7
+ data.tar.gz: ad37737f932f8d77f5d68760fd37ba4b46e868d8b9d17fd49d24b10fbe2563f58327567564c124525d9c4ce8958738743a573a5cf5ee4fe51954b8eced3a583f
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --color
2
+ --format documentation
2
3
  --require spec_helper
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.4
4
+
5
+ - Add Everything::Piece#full_path to return path of the piece
6
+
3
7
  ## 0.0.3
4
8
 
5
9
  - Change `Everything` from a class to a module
@@ -1,17 +1,19 @@
1
1
  module Everything
2
2
  class Piece
3
+ attr_reader :full_path
4
+
3
5
  def initialize(full_path)
4
6
  @full_path = full_path
5
7
  end
6
8
 
7
- def title
8
- @title ||= partitioned_content.first.sub('# ', '')
9
- end
10
-
11
9
  def content
12
10
  @content ||= partitioned_content.last
13
11
  end
14
12
 
13
+ def title
14
+ @title ||= partitioned_content.first.sub('# ', '')
15
+ end
16
+
15
17
  def raw_markdown
16
18
  @raw_markdown ||= File.read(content_path)
17
19
  end
@@ -1,3 +1,3 @@
1
1
  module Everything
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -1,5 +1,3 @@
1
- require './lib/everything/piece'
2
-
3
1
  describe Everything::Piece do
4
2
  let(:given_full_path) do
5
3
  'some/fake/path/here'
@@ -20,14 +18,40 @@ And it might even include multiple lines!
20
18
  MD
21
19
  end
22
20
 
23
- before do
24
- expect(File)
25
- .to receive(:read)
26
- .with(expected_markdown_file_path)
27
- .and_return(fake_markdown_text)
21
+ shared_context 'with fake markdown file' do
22
+ before do
23
+ expect(File)
24
+ .to receive(:read)
25
+ .with(expected_markdown_file_path)
26
+ .and_return(fake_markdown_text)
27
+ end
28
+ end
29
+
30
+ describe '#content' do
31
+ include_context 'with fake markdown file'
32
+
33
+ let(:expected_content) do
34
+ <<TEXT
35
+ The content is totally this right here.
36
+
37
+ And it might even include multiple lines!
38
+ TEXT
39
+ end
40
+
41
+ it 'is only the markdown after the title' do
42
+ expect(piece.content).to eq(expected_content)
43
+ end
44
+ end
45
+
46
+ describe '#full_path' do
47
+ it "returns the piece's full path" do
48
+ expect(piece.full_path).to eq(given_full_path)
49
+ end
28
50
  end
29
51
 
30
52
  describe '#raw_markdown' do
53
+ include_context 'with fake markdown file'
54
+
31
55
  let(:expected_raw_markdown) do
32
56
  fake_markdown_text
33
57
  end
@@ -38,6 +62,8 @@ MD
38
62
  end
39
63
 
40
64
  describe '#title' do
65
+ include_context 'with fake markdown file'
66
+
41
67
  let(:expected_title) do
42
68
  'Piece Title Here'
43
69
  end
@@ -46,18 +72,4 @@ MD
46
72
  expect(piece.title).to eq(expected_title)
47
73
  end
48
74
  end
49
-
50
- describe '#content' do
51
- let(:expected_content) do
52
- <<TEXT
53
- The content is totally this right here.
54
-
55
- And it might even include multiple lines!
56
- TEXT
57
- end
58
-
59
- it 'is only the markdown after the title' do
60
- expect(piece.content).to eq(expected_content)
61
- end
62
- end
63
75
  end
@@ -1,6 +1,8 @@
1
- require './lib/everything'
2
-
3
1
  describe Everything do
2
+ it 'has a version number' do
3
+ expect(Everything::VERSION).not_to be nil
4
+ end
5
+
4
6
  describe '.path' do
5
7
  let(:expected_path) do
6
8
  '/some/path/to/your/everything/repo/'
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'everything'
3
+
1
4
  # This file was generated by the `rspec --init` command. Conventionally, all
2
5
  # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
6
  # The generated `.rspec` file contains `--require spec_helper` which will cause
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: everything-core
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
  - Kyle Tolle