cheatly 0.1.1 → 0.2.0

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: 22a95708a0ba7e2cd6ae42d96ccb21f5831f625b
4
- data.tar.gz: 72ef8506ad5d566176224a1b46bb0320e7e831d8
3
+ metadata.gz: 7656523fbcf168c13c63840517245c92485c4566
4
+ data.tar.gz: 2d682bed842fd69b228571b62872d94176ee8c4a
5
5
  SHA512:
6
- metadata.gz: 119a38f79205a13aaed68d23659eac99c361e458b31c5d029320e256ab7c0c1a7cf1e05541620e7ef7efc9fb9a1519fead2304099ec39a0f74a357d636c737e5
7
- data.tar.gz: 3a08fe096011cdf93edd25a45e715d528039c14c2a09d99fcc41fca4e8b7e24939f20f45447ebdbef5df59c846adbb1b2b1347d001da83ac6c7827c9d37bc7af
6
+ metadata.gz: a132d1a64d03d3c855f040cde79fe4458733881a0772bf44e9bcca77fe4f9c0b15f1d4333d90839037f4e8817e8d1d0e702cf51f0593fd85571484bb0d59ae5a
7
+ data.tar.gz: f3dc1282b3c8a1c5b320b698d258cf4ddbfa7aa7ec5e49802d7b0ee2fae6c5d062b37461ec8c25a47a41729fa3e30281c2e85e74c059a7fe648021d8234cc726
@@ -3,5 +3,6 @@ rvm:
3
3
  - "1.9.3"
4
4
  - "2.0.0"
5
5
  - "2.1.0"
6
+ - "2.1.1"
6
7
 
7
8
  script: bundle exec rake test
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Cheatly
2
2
 
3
- [![Build Status](https://travis-ci.org/arthurnn/cheatly.png?branch=master)](https://travis-ci.org/arthurnn/cheatly)
4
- [![Code Climate](https://codeclimate.com/github/arthurnn/cheatly.png)](https://codeclimate.com/github/arthurnn/cheatly)
3
+ [![Build Status](https://travis-ci.org/arthurnn/cheatly.svg?branch=master)](https://travis-ci.org/arthurnn/cheatly)
4
+ [![Code Climate](http://img.shields.io/codeclimate/github/arthurnn/cheatly.svg)](https://codeclimate.com/github/arthurnn/cheatly)
5
5
 
6
6
  This is a command line toolset to handle the cheat-sheets reposity located at [sheets](https://github.com/arthurnn/cheatly/tree/master/sheets) folder.
7
7
 
@@ -53,5 +53,3 @@ Building from source will allow you to test changes to your code locally before
53
53
  Repeat steps 3-4 to check modified code.
54
54
 
55
55
 
56
- [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/arthurnn/cheatly/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
57
-
@@ -40,6 +40,9 @@ module Cheatly
40
40
  end
41
41
  end
42
42
 
43
+ desc "list sheets", "list all available sheets"
44
+ alias_method :ls, :list
45
+
43
46
  desc "create SHEET_NAME", "create a new sheet cheat"
44
47
  def create(handle)
45
48
  sheet = LocalSheet.new(handle)
@@ -31,11 +31,11 @@ module Cheatly
31
31
  def self.find(name)
32
32
  body = adapter.find(name)
33
33
  self.new(name, body, persisted: true)
34
- rescue Octokit::NotFound, Octokit::TooManyRequests
35
- puts "Octokit error."
34
+ rescue Octokit::NotFound
36
35
  nil
37
- rescue RuntimeError => e
36
+ rescue Exception => e
38
37
  puts e.message
38
+ nil
39
39
  end
40
40
 
41
41
  def self.all
@@ -1,3 +1,3 @@
1
1
  module Cheatly
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -53,6 +53,7 @@
53
53
 
54
54
  ## Completion
55
55
  (Here "2T" means Press TAB twice)
56
+
56
57
  $ 2T - All available commands(common)
57
58
  $ (string)2T - All available commands starting with (string)
58
59
  $ /2T - Entire directory structure including hidden one
@@ -2,35 +2,46 @@
2
2
 
3
3
  ## Encrypt/Decrypt data
4
4
  ### To encrypt data:
5
- gpg -e -u "Sender User Name" -r "Receiver User Name" somefile
5
+
6
+ gpg -e -u "Sender User Name" -r "Receiver User Name" somefile
6
7
 
7
8
  ### To decrypt data:
8
- gpg -d mydata.tar.gpg
9
+
10
+ gpg -d mydata.tar.gpg
9
11
 
10
12
  ## Keys manipulation
11
13
  ### Create a key:
12
- gpg --gen-key
14
+
15
+ gpg --gen-key
13
16
 
14
17
  ### Export a key:
15
- gpg --export -a "User Name" > public.key
18
+
19
+ gpg --export -a "User Name" > public.key
16
20
 
17
21
  ### Export a private key:
18
- gpg --export-secret-key -a "User Name" > private.key
22
+
23
+ gpg --export-secret-key -a "User Name" > private.key
19
24
 
20
25
  ### Import a friend's public key:
21
- gpg --import public.key
26
+
27
+ gpg --import public.key
22
28
 
23
29
  ### Import a private key:
24
- gpg --allow-secret-key-import --import private.key
30
+
31
+ gpg --allow-secret-key-import --import private.key
25
32
 
26
33
  ### Delete a public key:
27
- gpg --delete-key "User Name"
34
+
35
+ gpg --delete-key "User Name"
28
36
 
29
37
  ### Delete a private key:
30
- gpg --delete-secret-key "User Name"
38
+
39
+ gpg --delete-secret-key "User Name"
31
40
 
32
41
  ### To list the keys in your public key ring:
33
- gpg --list-keys
42
+
43
+ gpg --list-keys
34
44
 
35
45
  ### To list the keys in your secret key ring:
36
- gpg --list-secret-keys
46
+
47
+ gpg --list-secret-keys
@@ -0,0 +1,64 @@
1
+ `$@`
2
+ The file name of the target of the rule. If the target is an archive member,
3
+ then `$@` is the name of the archive file. In a pattern rule that has multiple
4
+ targets (see Introduction to Pattern Rules), `$@` is the name of whichever
5
+ target caused the rule's recipe to be run.
6
+
7
+
8
+ `$%`
9
+ The target member name, when the target is an archive member. See Archives.
10
+ For example, if the target is `foo.a`(`bar.o`) then `$%` is `bar.o` and `$@`
11
+ is `foo.a`. `$%` is empty when the target is not an archive member.
12
+
13
+
14
+ `$<`
15
+ The name of the first prerequisite. If the target got its recipe from
16
+ an implicit rule, this will be the first prerequisite added by the implicit
17
+ rule.
18
+
19
+
20
+ `$?`
21
+ The names of all the prerequisites that are newer than the target, with spaces
22
+ between them. For prerequisites which are archive members, only the named
23
+ member is used.
24
+
25
+
26
+ `$^`
27
+ The names of all the prerequisites, with spaces between them.
28
+ For prerequisites which are archive members, only the named member is used.
29
+ A target has only one prerequisite on each other file it depends on, no matter
30
+ how many times each file is listed as a prerequisite. So if you list
31
+ a prerequisite more than once for a target, the value of `$^` contains just
32
+ one copy of the name. This list does not contain any of the order-only
33
+ prerequisites; for those see the `$|` variable, below.
34
+
35
+
36
+ `$+`
37
+ This is like `$^`, but prerequisites listed more than once are duplicated
38
+ in the order they were listed in the makefile. This is primarily useful
39
+ for use in linking commands where it is meaningful to repeat library file
40
+ names in a particular order.
41
+
42
+
43
+ `$|`
44
+ The names of all the order-only prerequisites, with spaces between them.
45
+
46
+
47
+ `$*`
48
+ The stem with which an implicit rule matches. If the target is `dir/a.foo.b`
49
+ and the target pattern is `a.%.b` then the stem is `dir/foo`. The stem
50
+ is useful for constructing names of related files.
51
+
52
+ In a static pattern rule, the stem is part of the file name that matched
53
+ the `%` in the target pattern.
54
+
55
+ In an explicit rule, there is no stem; so `$*` cannot be determined in that
56
+ way. Instead, if the target name ends with a recognized suffix, `$*` is set
57
+ to the target name minus the suffix. For example, if the target name is
58
+ `foo.c`, then `$*` is set to `foo`, since `.c` is a suffix. GNU make does this
59
+ bizarre thing only for compatibility with other implementations of make.
60
+ You should generally avoid using `$*` except in implicit rules or static
61
+ pattern rules.
62
+
63
+ If the target name in an explicit rule does not end with a recognized suffix,
64
+ `$*` is set to the empty string for that rule.
@@ -2,17 +2,17 @@
2
2
 
3
3
  ## Headings:
4
4
 
5
- # h1 => <h1>h1</h1>
6
- ## h2 => <h2>h2</h2>
7
- ...
8
- ###### h6 => <h6>h6</h6>
5
+ # h1 => <h1>h1</h1>
6
+ ## h2 => <h2>h2</h2>
7
+ ...
8
+ ###### h6 => <h6>h6</h6>
9
9
 
10
10
  ## Paragraphs
11
11
 
12
- Separate paragraphs with double newlines. => <p>Separate paragraphs with double newlines.</p>
12
+ Separate paragraphs with double newlines. => <p>Separate paragraphs with double newlines.</p>
13
13
 
14
- This is a second paragraph. => <p>This is a second paragraph.
15
- This is not a third paragraph. => This is not a third paragraph.</p>
14
+ This is a second paragraph. => <p>This is a second paragraph.
15
+ This is not a third paragraph. => This is not a third paragraph.</p>
16
16
 
17
17
  ## Blockquotes:
18
18
  => <blockquote>
@@ -21,30 +21,47 @@
21
21
 
22
22
  ## Code:
23
23
 
24
- `code goes here` => <code>code goes here</code>
24
+ `code goes here` => <code>code goes here</code>
25
+
26
+ ``` => <code>
27
+ <ul> => <ul>
28
+ <li>Some text</li> => <li>Some text</li>
29
+ </ul> => </ul>
30
+ ``` => </code>
25
31
 
26
32
  ## Lists:
27
- => <ul>
28
- * item 1 => <li>item 1</li>
29
- * item 2 => <li>item 2</li>
30
- * item 3 => <li>item 3</li>
31
- => </ul>
32
-
33
- => <ol>
34
- 1. item 1 => <li>item 1</li>
35
- 1. item 2 => <li>item 2</li>
36
- 1. item 3 => <li>item 3</li>
37
- => </ol>
33
+
34
+ => <ul>
35
+ * item 1 => <li>item 1</li>
36
+ * item 2 => <li>item 2</li>
37
+ * item 3 => <li>item 3</li>
38
+ => </ul>
39
+
40
+ => <ol>
41
+ 1. item 1 => <li>item 1</li>
42
+ 3. item 2 => <li>item 2</li>
43
+ 1. item 3 => <li>item 3</li>
44
+ => </ol>
45
+
46
+ ## Tables:
47
+
48
+ => <table>
49
+ Header | Header => <tr><th>Header</th><th>Header</th></tr>
50
+ ---------- | ---------------
51
+ Some | Text => <tr><th>Some</th><th>Text</th></tr>
52
+ Another | Example => <tr><th>Another</th><th>Example</th></tr>
53
+ Next | Line => <tr><th>Next</th><th>Line</th></tr>
54
+ => <table>
38
55
 
39
56
  ## Inline:
40
57
 
41
- *emphasis* => <em>emphasis</em>
42
- **strong** => <strong>strong</strong>
58
+ *emphasis* => <em>emphasis</em>
59
+ **strong** => <strong>strong</strong>
43
60
 
44
61
  ## Links:
45
62
 
46
- [Text to display](http://example.com/) => <a href='http://example.com'>Text to display</a>
63
+ [Text to display](http://example.com/) => <a href='http://example.com'>Text to display</a>
47
64
 
48
65
  ## Images:
49
66
 
50
- ![alt text](/path/to/image.jpg) => <img src='/path/to/image.jpg alt='alt text' />
67
+ ![alt text](/path/to/image.jpg) => <img src='/path/to/image.jpg alt='alt text' />
@@ -2,20 +2,20 @@
2
2
 
3
3
  ## Generating a new migration
4
4
 
5
- rails generate migration AddPartNumberToProducts
5
+ rails generate migration AddPartNumberToProducts
6
6
 
7
7
  ## Methods:
8
8
 
9
- create_table(name, options)
10
- drop_table(name)
11
- rename_table(old_name, new_name)
12
- add_column(table_name, column_name, type, options)
13
- rename_column(table_name, column_name, new_column_name)
14
- change_column(table_name, column_name, type, options)
15
- remove_column(table_name, column_name)
16
- add_index(table_name, column_name, index_type)
17
- remove_index(table_name, column_name)
18
- change_table(table_name) { |table| ... }
9
+ create_table(name, options)
10
+ drop_table(name)
11
+ rename_table(old_name, new_name)
12
+ add_column(table_name, column_name, type, options)
13
+ rename_column(table_name, column_name, new_column_name)
14
+ change_column(table_name, column_name, type, options)
15
+ remove_column(table_name, column_name)
16
+ add_index(table_name, column_name, index_type)
17
+ remove_index(table_name, column_name)
18
+ change_table(table_name) { |table| ... }
19
19
 
20
20
  ## Available Column Types (mappings are below):
21
21
 
@@ -43,19 +43,19 @@
43
43
 
44
44
  ## Rake Tasks:
45
45
 
46
- - rake db:schema:dump: run after you create a model to capture the schema.rb
47
- - rake db:schema:import: import the schema file into the current database
46
+ - `rake db:schema:dump`: run after you create a model to capture the schema.rb
47
+ - `rake db:schema:import`: import the schema file into the current database
48
48
  (on error, check if your schema.rb has `force: true` on the create table
49
49
  statements)
50
- - rails generate migration (migration name): generate a new migration with
50
+ - `rails generate migration (migration name)`: generate a new migration with
51
51
  a new 'highest' version (run 'rails generate migration' for this info at
52
52
  your fingertips)
53
- - rake db:migrate: migrate your current database to the most recent version
54
- - rake db:migrate VERSION=5: migrate your current database to a specific
53
+ - `rake db:migrate`: migrate your current database to the most recent version
54
+ - `rake db:migrate VERSION=5`: migrate your current database to a specific
55
55
  version (in this case, version 5)
56
- - rake db:rollback: migrate down one migration
57
- - rake db:rollback STEP=3: migrate down three migrations
58
- - rake db:migrate RAILS_ENV=production: migrate your production database
56
+ - `rake db:rollback`: migrate down one migration
57
+ - `rake db:rollback STEP=3`: migrate down three migrations
58
+ - `rake db:migrate RAILS_ENV=production`: migrate your production database
59
59
 
60
60
  ## SQL:
61
61
 
@@ -1,24 +1,23 @@
1
1
  # `sprintf` formatters
2
2
 
3
- %b => Binary integer
4
- %c => Single character
5
- %d => Decimal integer
6
- %e => Decimal integer displayed in exponential form (3e+07)
7
- %E => Decimal integer displayed in exponential form (3E+07)
8
- %f => Floating point number
9
- %g => Same as %e if exponent is less than -4, %f otherwise
10
- %G => Same as %E if exponent is less than -4, %f otherwise
11
- %o => Octal integer
12
- %s => String
13
- %u => Unsigned decimal integer
14
- %x => Hexadecimal integer (2a)
15
- %X => Hexadecimal integer uppercase (2A)
16
- %02d => 0 padded two digits
17
- %.02f => round to the hundredths
18
- %+ => +/- sign
19
-
3
+ %b => Binary integer
4
+ %c => Single character
5
+ %d => Decimal integer
6
+ %e => Decimal integer displayed in exponential form (3e+07)
7
+ %E => Decimal integer displayed in exponential form (3E+07)
8
+ %f => Floating point number
9
+ %g => Same as %e if exponent is less than -4, %f otherwise
10
+ %G => Same as %E if exponent is less than -4, %f otherwise
11
+ %o => Octal integer
12
+ %s => String
13
+ %u => Unsigned decimal integer
14
+ %x => Hexadecimal integer (2a)
15
+ %X => Hexadecimal integer uppercase (2A)
16
+ %02d => 0 padded two digits
17
+ %.02f => round to the hundredths
18
+ %+ => +/- sign
20
19
 
21
20
  ## Width & alignment
22
21
 
23
- "%10s" % "hello" => " hello"
24
- "%-10s" % "hello" => "hello "
22
+ "%10s" % "hello" => " hello"
23
+ "%-10s" % "hello" => "hello "
metadata CHANGED
@@ -1,125 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheatly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arthur Neves
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-28 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.7.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.7.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pager
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.0.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.0.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: redcarpet
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: colorize
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.6.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.6.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thor
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.18.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.18.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.3'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.3'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: minitest
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: 5.0.8
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
124
  version: 5.0.8
125
125
  description: A cheat-sheet cli for a cheat repository
@@ -130,8 +130,8 @@ executables:
130
130
  extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
- - ".gitignore"
134
- - ".travis.yml"
133
+ - .gitignore
134
+ - .travis.yml
135
135
  - Gemfile
136
136
  - LICENSE.txt
137
137
  - README.md
@@ -152,6 +152,7 @@ files:
152
152
  - sheets/gem_release.md
153
153
  - sheets/gpg.md
154
154
  - sheets/help.md
155
+ - sheets/make.md
155
156
  - sheets/markdown.md
156
157
  - sheets/migrations.md
157
158
  - sheets/sprintf.md
@@ -169,17 +170,17 @@ require_paths:
169
170
  - lib
170
171
  required_ruby_version: !ruby/object:Gem::Requirement
171
172
  requirements:
172
- - - ">="
173
+ - - '>='
173
174
  - !ruby/object:Gem::Version
174
175
  version: '0'
175
176
  required_rubygems_version: !ruby/object:Gem::Requirement
176
177
  requirements:
177
- - - ">="
178
+ - - '>='
178
179
  - !ruby/object:Gem::Version
179
180
  version: '0'
180
181
  requirements: []
181
182
  rubyforge_project:
182
- rubygems_version: 2.2.0
183
+ rubygems_version: 2.0.14
183
184
  signing_key:
184
185
  specification_version: 4
185
186
  summary: A cheat-sheet cli for a cheat repository