ernest 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +4 -2
- data/examples/{post-1.markdown → post-1.markdown.example} +0 -0
- data/lib/ernest/version.rb +1 -1
- data/lib/ernest.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef3662b5e28a287b28b620de4f46e41e044cd668
|
4
|
+
data.tar.gz: cf100d059b44a2122ceda35b99ca9faa23c40a6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6ca3e65b7b20379234073cd2057df9d7309cb1f9328c66af5fd7fc00a43fca96db247221d9b1dcadbcb328d3a39041b120a6e5e275eb5901a7326a399440603
|
7
|
+
data.tar.gz: 18d06b9d389fca534fff55766afb5eb997cd78397249505bd03901a62cf520d4042f33949dcff3c0000a64a655e038980a44c1da77fa661ca0e73b13a09d1db5
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -37,12 +37,14 @@ API_ENDPOINT="http://localhost:3000/api/posts"
|
|
37
37
|
TOKEN="a-random-token"
|
38
38
|
```
|
39
39
|
|
40
|
-
|
40
|
+
To make this super easy, Ernest comes bundled with `dotenv`, which means that you can add these variables to a file called `.env` and place it wherever you want to create your drafts from (e.g. a `~/posts` directory).
|
41
|
+
|
42
|
+
After you've set those variables, write your post in plain old markdown, adding any extra fields you want to send to the server as metadata. See an example [here](/examples/post-1.markdown.example).
|
41
43
|
|
42
44
|
When you're done with the writing, create a draft:
|
43
45
|
|
44
46
|
```
|
45
|
-
$
|
47
|
+
$ ernest post-name.markdown
|
46
48
|
```
|
47
49
|
|
48
50
|
## Contributing
|
File without changes
|
data/lib/ernest/version.rb
CHANGED
data/lib/ernest.rb
CHANGED
@@ -11,11 +11,13 @@ module Ernest
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def call
|
14
|
-
HTTParty.post(
|
14
|
+
response = HTTParty.post(
|
15
15
|
ENV['API_ENDPOINT'],
|
16
16
|
body: post,
|
17
17
|
headers: { 'Authorization' => 'Token token="' + ENV['TOKEN'] + '"' }
|
18
18
|
)
|
19
|
+
|
20
|
+
puts response unless response.code == 200
|
19
21
|
end
|
20
22
|
|
21
23
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ernest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zamith
|
@@ -95,7 +95,7 @@ files:
|
|
95
95
|
- Rakefile
|
96
96
|
- bin/ernest
|
97
97
|
- ernest.gemspec
|
98
|
-
- examples/post-1.markdown
|
98
|
+
- examples/post-1.markdown.example
|
99
99
|
- lib/ernest.rb
|
100
100
|
- lib/ernest/version.rb
|
101
101
|
homepage: ''
|