everything-core 0.0.8 → 0.0.9
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/CHANGELOG.md +4 -0
- data/README.md +25 -4
- data/bin/bundler +16 -0
- data/bin/console +12 -10
- data/bin/dotenv +16 -0
- data/bin/htmldiff +16 -0
- data/bin/ldiff +16 -0
- data/bin/rake +16 -0
- data/bin/rspec +16 -0
- data/bin/setup +14 -6
- data/everything-core.gemspec +1 -1
- data/lib/everything/piece/content.rb +4 -4
- data/lib/everything/piece/metadata.rb +5 -0
- data/lib/everything/version.rb +1 -1
- data/spec/everything/piece/content_spec.rb +12 -0
- metadata +17 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ec10f405f9e3b3bbaf85dba2c298004fb2a0cf8
|
4
|
+
data.tar.gz: 603c8bf8d70377ab4e613e1489d26e5fbbb35212
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c2420306c0192aae6105c9298954a7ed355e0cfc792ecccf5bd60a016e34ac5164df2ccf7a96e734c1909f9c8e964410405abfbe7402b102ff5f81845559ccb
|
7
|
+
data.tar.gz: 06b03c77b76c83c908c728abe97ac13478528883cbe6ea8f3ab1431955b99ab1c972342623d06d4643276c280072a060ae9a621c77de5a0a24c464c71e501177
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Must define these environment variables:
|
|
22
22
|
Add this line to your application's Gemfile:
|
23
23
|
|
24
24
|
```ruby
|
25
|
-
gem
|
25
|
+
gem 'everything-core', require: 'everything'
|
26
26
|
```
|
27
27
|
|
28
28
|
And then execute:
|
@@ -34,6 +34,24 @@ Or install it yourself as:
|
|
34
34
|
$ gem install everything-core
|
35
35
|
|
36
36
|
|
37
|
+
## Requiring
|
38
|
+
|
39
|
+
You can require it yourself in your code:
|
40
|
+
|
41
|
+
```
|
42
|
+
require 'everything'
|
43
|
+
```
|
44
|
+
|
45
|
+
Or, if you use Bundler and list the gem in your Gemfile, you can require all the
|
46
|
+
gems from your Gemfile:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
require 'rubygems'
|
50
|
+
require 'bundler/setup'
|
51
|
+
Bundler.require(:default)
|
52
|
+
```
|
53
|
+
|
54
|
+
|
37
55
|
## Usage
|
38
56
|
|
39
57
|
This assumes you have a `EVERYTHING_PATH` environment variable either set in
|
@@ -42,7 +60,7 @@ your shell or in dotenv's `.env` file.
|
|
42
60
|
For example, let's assume you have the following folder and file under your
|
43
61
|
everything path
|
44
62
|
|
45
|
-
```
|
63
|
+
```ruby
|
46
64
|
your-piece-here/index.md
|
47
65
|
|
48
66
|
# Your Piece Here
|
@@ -54,7 +72,7 @@ The rest of the body of your file...
|
|
54
72
|
To use the piece from IRB, you could do the following to get the piece's title
|
55
73
|
and content.
|
56
74
|
|
57
|
-
```
|
75
|
+
```ruby
|
58
76
|
require 'everything'
|
59
77
|
|
60
78
|
piece_path = File.join(Everything.path, 'your-piece-here')
|
@@ -67,8 +85,11 @@ piece['categories'] # Returns the value for the `categories` metadata key
|
|
67
85
|
piece.public? # Convience method to return the value for the boolean `public` metadata key
|
68
86
|
piece.content # Return an instance of the piece's content
|
69
87
|
piece.metadata # Return an instance of the piece's metadata
|
88
|
+
```
|
70
89
|
|
71
|
-
|
90
|
+
You can also edit a piece's content and metadata
|
91
|
+
|
92
|
+
```ruby
|
72
93
|
piece.raw_markdown = some_markdown # Sets the raw_markdown on the piece's content
|
73
94
|
piece.raw_yaml = some_yaml # Sets the raw_yaml on the piece's metadata
|
74
95
|
piece.save # Save the piece's content and metadata to disk
|
data/bin/bundler
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'bundler' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require "pathname"
|
10
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require "rubygems"
|
14
|
+
require "bundler/setup"
|
15
|
+
|
16
|
+
load Gem.bin_path("bundler", "bundler")
|
data/bin/console
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'console' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
2
8
|
|
3
|
-
require "
|
4
|
-
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
require "pathname"
|
10
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
8
12
|
|
9
|
-
|
10
|
-
|
11
|
-
# Pry.start
|
13
|
+
require "rubygems"
|
14
|
+
require "bundler/setup"
|
12
15
|
|
13
|
-
|
14
|
-
IRB.start
|
16
|
+
load Gem.bin_path("everything-core", "console")
|
data/bin/dotenv
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'dotenv' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require "pathname"
|
10
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require "rubygems"
|
14
|
+
require "bundler/setup"
|
15
|
+
|
16
|
+
load Gem.bin_path("dotenv", "dotenv")
|
data/bin/htmldiff
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'htmldiff' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require "pathname"
|
10
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require "rubygems"
|
14
|
+
require "bundler/setup"
|
15
|
+
|
16
|
+
load Gem.bin_path("diff-lcs", "htmldiff")
|
data/bin/ldiff
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'ldiff' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require "pathname"
|
10
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require "rubygems"
|
14
|
+
require "bundler/setup"
|
15
|
+
|
16
|
+
load Gem.bin_path("diff-lcs", "ldiff")
|
data/bin/rake
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rake' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require "pathname"
|
10
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require "rubygems"
|
14
|
+
require "bundler/setup"
|
15
|
+
|
16
|
+
load Gem.bin_path("rake", "rake")
|
data/bin/rspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rspec' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require "pathname"
|
10
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require "rubygems"
|
14
|
+
require "bundler/setup"
|
15
|
+
|
16
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/setup
CHANGED
@@ -1,8 +1,16 @@
|
|
1
|
-
#!/usr/bin/env
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'setup' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
5
8
|
|
6
|
-
|
9
|
+
require "pathname"
|
10
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
7
12
|
|
8
|
-
|
13
|
+
require "rubygems"
|
14
|
+
require "bundler/setup"
|
15
|
+
|
16
|
+
load Gem.bin_path("everything-core", "setup")
|
data/everything-core.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_runtime_dependency 'dotenv', '~> 2.1'
|
22
|
-
spec.add_runtime_dependency 'fastenv', '= 0.0.
|
22
|
+
spec.add_runtime_dependency 'fastenv', '= 0.0.3'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.11'
|
25
25
|
spec.add_development_dependency 'rake', '~> 10.5'
|
@@ -7,6 +7,10 @@ module Everything
|
|
7
7
|
@piece_path = piece_path
|
8
8
|
end
|
9
9
|
|
10
|
+
def file_name
|
11
|
+
'index.md'
|
12
|
+
end
|
13
|
+
|
10
14
|
def file_path
|
11
15
|
@file_path ||= File.join(piece_path, file_name)
|
12
16
|
end
|
@@ -36,10 +40,6 @@ module Everything
|
|
36
40
|
private
|
37
41
|
attr_reader :piece_path
|
38
42
|
|
39
|
-
def file_name
|
40
|
-
'index.md'
|
41
|
-
end
|
42
|
-
|
43
43
|
def partitioned_text
|
44
44
|
@partitioned_text ||= raw_markdown.partition("\n\n")
|
45
45
|
end
|
@@ -6,6 +6,11 @@ module Everything
|
|
6
6
|
class Metadata
|
7
7
|
extend Forwardable
|
8
8
|
|
9
|
+
# TODO: Need to add some ways in here to save the metadata file once it's
|
10
|
+
# been edited.
|
11
|
+
# TODO: Also add a #to_s or #inspect methods to render the raw_yaml
|
12
|
+
# TODO: Also add a #[]= here that delegates to raw_yaml as well.
|
13
|
+
|
9
14
|
def initialize(piece_path)
|
10
15
|
@piece_path = piece_path
|
11
16
|
end
|
data/lib/everything/version.rb
CHANGED
@@ -27,6 +27,18 @@ MD
|
|
27
27
|
described_class.new(tmp_piece_path)
|
28
28
|
end
|
29
29
|
|
30
|
+
describe '#file_name' do
|
31
|
+
include_context 'with tmp piece on disk'
|
32
|
+
|
33
|
+
let(:expected_file_name) do
|
34
|
+
'index.md'
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'is the markdown file according to everything convention' do
|
38
|
+
expect(content.file_name).to eq(expected_file_name)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
30
42
|
describe '#file_path' do
|
31
43
|
include_context 'with tmp piece on disk'
|
32
44
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: everything-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Tolle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0.
|
33
|
+
version: 0.0.3
|
34
34
|
type: :runtime
|
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: 0.0.
|
40
|
+
version: 0.0.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,7 +84,13 @@ description: Gives you access to pieces within your everything repo.
|
|
84
84
|
email:
|
85
85
|
- kyle@nullsix.com
|
86
86
|
executables:
|
87
|
+
- bundler
|
87
88
|
- console
|
89
|
+
- dotenv
|
90
|
+
- htmldiff
|
91
|
+
- ldiff
|
92
|
+
- rake
|
93
|
+
- rspec
|
88
94
|
- setup
|
89
95
|
extensions: []
|
90
96
|
extra_rdoc_files: []
|
@@ -98,7 +104,13 @@ files:
|
|
98
104
|
- LICENSE
|
99
105
|
- README.md
|
100
106
|
- Rakefile
|
107
|
+
- bin/bundler
|
101
108
|
- bin/console
|
109
|
+
- bin/dotenv
|
110
|
+
- bin/htmldiff
|
111
|
+
- bin/ldiff
|
112
|
+
- bin/rake
|
113
|
+
- bin/rspec
|
102
114
|
- bin/setup
|
103
115
|
- everything-core.gemspec
|
104
116
|
- lib/everything.rb
|
@@ -132,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
144
|
version: '0'
|
133
145
|
requirements: []
|
134
146
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.6.11
|
136
148
|
signing_key:
|
137
149
|
specification_version: 4
|
138
150
|
summary: Library for working with your `everything` repository.
|