pushnote 0.0.1 → 0.0.2

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: dc4a2cb12ee40b95013e7c320a6b0cf6ea31162d
4
- data.tar.gz: 16e2a5eb798e4fd3a02c4b284df25ffae99a0f72
3
+ metadata.gz: 02f0fcafe734853ef988ad44440286f3555def74
4
+ data.tar.gz: 0e5589aba69827aa38c02bdb402d5b6bab4f0ae5
5
5
  SHA512:
6
- metadata.gz: c27697ff711fa9aff1a00cd76192139267bbaa02dd407b526d2581ee15dcdfb97a83ca84944e12cfdbbca8d3627cc197c3cc65178ad8ef2ba6fa56c42918a369
7
- data.tar.gz: a22f7325738f94e0ced55b319ea8b6d26ca74fef5db344aa9478333f8bde28b788779268da84bf59d1c170a740b9da029b885ff3d4e66851b72adef04e8d287f
6
+ metadata.gz: cde1100ac42ad9c6a128d5164f271bc3a02db8948527b236cdeb820279551fba3527c3b4a57916d910b272f4fad9eab859997e0c57e9f784f382ff5f7d68b359
7
+ data.tar.gz: 210369e532dad13c540d479b15113eb04ac3c5b1a790a4b985a91e0a823915bc9dd3d97100e0e9495924fe46078a054e093c433749dcf16f42e0535a0979fe4a
data/README.md CHANGED
@@ -1,26 +1,45 @@
1
1
  # Pushnote
2
2
 
3
- TODO: Write a gem description
3
+ Push notes to a central location.
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
8
-
7
+ Install the CLI tool:
9
8
  ```ruby
10
- gem 'pushnote'
9
+ gem install pushnote
11
10
  ```
12
11
 
13
- And then execute:
12
+ ## Usage
13
+
14
+ The `pushnote` command persists `stdin` to the specified pushnote server.
14
15
 
15
- $ bundle
16
+ For example, say you have created a note in `/tmp/note.md`:
17
+ ```
18
+ ### Ruby Sauce
19
+ Wow, didn't know you could do this:
20
+ x = 1 + 2
21
+ ```
16
22
 
17
- Or install it yourself as:
23
+ To send this note to the pushnote server:
24
+ ```
25
+ cat /tmp/node.md | pushnote --title "Ruby can add numbers, wow"
26
+ ```
18
27
 
19
- $ gem install pushnote
28
+ ## Development
20
29
 
21
- ## Usage
30
+ Test locally by running the pushnote server:
31
+ ```
32
+ git clone git@github.com:corytheboyd/pushnote-server.git
33
+ cd pushnote-server
34
+ bundle install
35
+ bundle exec rake db:create db:migrate
36
+ rackup -p 3000
37
+ ```
22
38
 
23
- TODO: Write usage instructions here
39
+ Then, specify the pushnote server host when using the CLI:
40
+ ```
41
+ pushnote --host http://localhost:3000
42
+ ```
24
43
 
25
44
  ## Contributing
26
45
 
@@ -23,6 +23,10 @@ module Pushnote
23
23
  opts.on('-t TITLE', '--title TITLE', 'Note title') do |title|
24
24
  note.title = title
25
25
  end
26
+
27
+ opts.on('-h HOST', '--host HOST', 'Pushnote server host') do |host|
28
+ note.set_server_host(host)
29
+ end
26
30
  }.parse!
27
31
  end
28
32
 
@@ -13,6 +13,12 @@ module Pushnote
13
13
  self.class.post('/notes', { body: serialize.to_json })
14
14
  end
15
15
 
16
+ def set_server_host(host)
17
+ self.class.base_uri(host)
18
+ end
19
+
20
+ private
21
+
16
22
  def serialize
17
23
  {
18
24
  title: title,
@@ -1,3 +1,3 @@
1
1
  module Pushnote
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushnote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cory Boyd