pushnote 1.1.2 → 1.2.0

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: 44c3e58822dfc8454ea3758f2a0489d7077a3b8f
4
- data.tar.gz: 5848961d16b8b9fbadf01719059860751d040561
3
+ metadata.gz: 3a028c995633756a2ca27472962af325c045e2b3
4
+ data.tar.gz: ef93321f4bdf3168e4aa53695b2dfebcabd8f813
5
5
  SHA512:
6
- metadata.gz: 1a601915ce74cbf7a8b1401b4766f8df90b356c6ea4662c50ee4ba64c44cf7fb8d112c8cec337bdc0faca5574ad612b9726c60898c4ad54cc6f95bc4264f6aae
7
- data.tar.gz: 199094c870f79bdb7e1be8663abe9b2951482a8cab1926280b2a9e4e27005510345cdad8e5c27148e317685884286dcee3b02f1af6792b4dba07d813cb0ecdff
6
+ metadata.gz: 70aa29a5cbe295368ac26c9e5038c0137cbeb09324ba0fc3acd14acc851517965687532c6835ed7d88a441a5402cc95a56ccbd81a79db21817ceddeb0c368145
7
+ data.tar.gz: 54f21c1008a59af3c7127db6ef97687889faa5f257539628b795e0e95792a8b8183c93c94dd92985d1a145df8865562f84506ebbbf918999fc525a4a400a11d6
data/README.md CHANGED
@@ -1,45 +1,29 @@
1
1
  # Pushnote
2
2
 
3
- Push notes to a central location.
3
+ Push notes from the command line to a local server.
4
4
 
5
5
  ## Installation
6
6
 
7
- Install the CLI tool:
7
+ Install the gem:
8
8
  ```
9
9
  gem install pushnote
10
+ rbenv rehash
10
11
  ```
11
12
 
12
- ## Usage
13
-
14
- The `pushnote` command persists `stdin` to the specified pushnote server.
15
-
16
- For example, say you have created a note in `/tmp/note.md`:
13
+ Start the local pushnote server:
17
14
  ```
18
- ### Ruby Sauce
19
- Wow, didn't know you could do this:
20
- x = 1 + 2
15
+ pushnoted start
21
16
  ```
22
17
 
23
- To send this note to the pushnote server:
24
- ```
25
- cat /tmp/node.md | pushnote --title "Ruby can add numbers, wow"
26
- ```
27
-
28
- ## Development
18
+ ## Usage
29
19
 
30
- Test locally by running the pushnote server:
20
+ Push a note:
31
21
  ```
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
22
+ echo This is the note body. | pushnote --title "My note"
37
23
  ```
38
24
 
39
- Then, specify the pushnote server host when using the CLI:
40
- ```
41
- pushnote --host http://localhost:3000
42
- ```
25
+ View all notes by vising `localhost:9283` in your browser:
26
+ ![image](https://cloud.githubusercontent.com/assets/692632/5994336/e14900bc-aa23-11e4-8bbd-40266a7d2904.png)
43
27
 
44
28
  ## Contributing
45
29
 
@@ -10,6 +10,7 @@ module Pushnote
10
10
  end
11
11
 
12
12
  def run
13
+ note.collect_system_info
13
14
  read_note_body
14
15
  save_note
15
16
  end
@@ -7,6 +7,7 @@ module Pushnote
7
7
  headers 'Content-Type' => 'application/json', 'Accept' => 'application/json'
8
8
 
9
9
  attr_accessor :title, :body
10
+ attr_reader :top_report, :df_report
10
11
 
11
12
  def initialize
12
13
  set_server_host(configuration.server)
@@ -20,17 +21,36 @@ module Pushnote
20
21
  self.class.base_uri(host)
21
22
  end
22
23
 
24
+ def collect_system_info
25
+ [
26
+ Thread.new { create_top_report },
27
+ Thread.new { create_df_report }
28
+ ].each(&:join)
29
+ end
30
+
23
31
  private
24
32
 
25
33
  def serialize
26
34
  {
27
35
  title: title,
28
- body: body
36
+ body: body,
37
+ snapshot: {
38
+ top: top_report,
39
+ df: df_report
40
+ }
29
41
  }
30
42
  end
31
43
 
32
44
  def configuration
33
45
  @configuration ||= Configuration.new
34
46
  end
47
+
48
+ def create_top_report
49
+ @top_report ||= `top -l 1 -o +command -O pid`
50
+ end
51
+
52
+ def create_df_report
53
+ @df_report ||= `df -h`
54
+ end
35
55
  end
36
56
  end
@@ -1,3 +1,3 @@
1
1
  module Pushnote
2
- VERSION = "1.1.2"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushnote
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cory Boyd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-01 00:00:00.000000000 Z
11
+ date: 2015-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler