ernest 0.0.2 → 0.0.3

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: b010659df81260de657f7c0d6dc188bec9fb4dcc
4
- data.tar.gz: 7ef0e6147906013eac6a9d77cbf6645a4b050442
3
+ metadata.gz: ef3662b5e28a287b28b620de4f46e41e044cd668
4
+ data.tar.gz: cf100d059b44a2122ceda35b99ca9faa23c40a6e
5
5
  SHA512:
6
- metadata.gz: 24c4d548a82800c5c8a43a9540542a76599acbf0503ec7d1d3fcd9ff51526f54a8230dea935423aeefbed2ffd389c90878cf3ed21e000b39d91c4ee57097cfec
7
- data.tar.gz: 7ea63da42e98b7ec90bfc4239da9a52a73557161bfc948b58a131dc722bb1515ddde2379a483a92de8e7ac4f2f3500b0741757887ad85b649e8c3402cdc995dc
6
+ metadata.gz: a6ca3e65b7b20379234073cd2057df9d7309cb1f9328c66af5fd7fc00a43fca96db247221d9b1dcadbcb328d3a39041b120a6e5e275eb5901a7326a399440603
7
+ data.tar.gz: 18d06b9d389fca534fff55766afb5eb997cd78397249505bd03901a62cf520d4042f33949dcff3c0000a64a655e038980a44c1da77fa661ca0e73b13a09d1db5
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in ernest.gemspec
4
4
  gemspec
5
+
6
+ gem 'pry'
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
- 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).
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
- $ bundle exec ernest post-name.markdown
47
+ $ ernest post-name.markdown
46
48
  ```
47
49
 
48
50
  ## Contributing
@@ -1,3 +1,3 @@
1
1
  module Ernest
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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: ''