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 +4 -4
- data/README.md +10 -26
- data/lib/pushnote/cli.rb +1 -0
- data/lib/pushnote/note.rb +21 -1
- data/lib/pushnote/version.rb +1 -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: 3a028c995633756a2ca27472962af325c045e2b3
|
4
|
+
data.tar.gz: ef93321f4bdf3168e4aa53695b2dfebcabd8f813
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
3
|
+
Push notes from the command line to a local server.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
Install the
|
7
|
+
Install the gem:
|
8
8
|
```
|
9
9
|
gem install pushnote
|
10
|
+
rbenv rehash
|
10
11
|
```
|
11
12
|
|
12
|
-
|
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
|
-
|
19
|
-
Wow, didn't know you could do this:
|
20
|
-
x = 1 + 2
|
15
|
+
pushnoted start
|
21
16
|
```
|
22
17
|
|
23
|
-
|
24
|
-
```
|
25
|
-
cat /tmp/node.md | pushnote --title "Ruby can add numbers, wow"
|
26
|
-
```
|
27
|
-
|
28
|
-
## Development
|
18
|
+
## Usage
|
29
19
|
|
30
|
-
|
20
|
+
Push a note:
|
31
21
|
```
|
32
|
-
|
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
|
-
|
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
|
|
data/lib/pushnote/cli.rb
CHANGED
data/lib/pushnote/note.rb
CHANGED
@@ -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
|
data/lib/pushnote/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|