everything-core 0.0.6 → 0.0.7

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
2
  SHA1:
3
- metadata.gz: b1e55885b20990f6ab77929b12caf60764e35147
4
- data.tar.gz: f1abad4f7afdad19f21149cfcc9ff84f0c287380
3
+ metadata.gz: 8aca9092f34828f75505f2d3c36a03bd20845114
4
+ data.tar.gz: 7dfbd73bc6f5a5009f5abe169359067bca9b0b29
5
5
  SHA512:
6
- metadata.gz: 1412bc7491dbe5f794afe3feaf2592d3a5a1fd06d652cfdfbbf1f5a562021699592a056464d14383f786960a0d0a7efaaacea88607555805df1586f967268cce
7
- data.tar.gz: 09b06432902bedaee4cc7629207984e4e1c81c939f00258a4859b2afdc1db6acd7a7d18c97ebc96d73863d423ca954624ced23b222fe4272885570fc434e6781
6
+ metadata.gz: f7d1b41ee152d93d758cfa0cbe2b082cb07c11d39dfcdc45063bf7f756d669d95d31d8678b5e4c14a13408779f9dfc91ee9aa8f85854c84da6e03d8ea9738cb3
7
+ data.tar.gz: 64dd8236c33db109b282af925f74b60acb51045ff30cdf3a80b2c501c489b7a36212c812ee65fbcd2d12b3ce5aa143131505046158fffdedc98fb50bcb07ca5d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.7
4
+
5
+ - Add a piece#name to return the name from the piece's path
6
+
3
7
  ## 0.0.6
4
8
 
5
9
  - Add an Everything::Piece::Content class
data/README.md CHANGED
@@ -60,6 +60,7 @@ require 'everything'
60
60
  piece_path = File.join(Everything.path, 'your-piece-here')
61
61
  piece = Everything::Piece.new(piece_path)
62
62
 
63
+ piece.name # => 'your-piece-here'
63
64
  piece.title # => "Your Piece Here"
64
65
  piece.body # => "The rest of the body of your file...\n\n"
65
66
  piece['categories'] # Returns the value for the `categories` metadata key
@@ -21,6 +21,10 @@ module Everything
21
21
  def public?
22
22
  metadata['public']
23
23
  end
24
+
25
+ def name
26
+ File.basename(full_path)
27
+ end
24
28
  end
25
29
  end
26
30
 
@@ -1,3 +1,3 @@
1
1
  module Everything
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  describe Everything::Piece do
2
2
  let(:given_full_path) do
3
- 'some/fake/path/here'
3
+ 'some/fake/path/here-is-our-piece'
4
4
  end
5
5
  let(:piece) do
6
6
  described_class.new(given_full_path)
@@ -63,6 +63,16 @@ describe Everything::Piece do
63
63
  end
64
64
  end
65
65
 
66
+ describe '#name' do
67
+ let(:expected_name) do
68
+ 'here-is-our-piece'
69
+ end
70
+
71
+ it 'is the last part of the path' do
72
+ expect(piece.name).to eq(expected_name)
73
+ end
74
+ end
75
+
66
76
  describe '#public?' do
67
77
  let(:metadata_double) do
68
78
  instance_double(Everything::Piece::Metadata)
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Tolle