cheatly 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWE4Y2MzYzU2MGNhMTE3YzAxN2E5N2JkOGVmODBkNmZkY2VlZWZiNA==
4
+ MGMyM2JmZjdkNDRmYTFlYjY1MGZlZmRiNmFmOTY2YTQ5YzU4ZWRkYg==
5
5
  data.tar.gz: !binary |-
6
- OGZiNTAzZDEyMmNlNmE5NmVjYTkwZDAxZTZhYTEyYWFiODQ3NDdlNg==
6
+ NmE0ZGQ2ZDY3ZmRmMjYxY2YzNzk5ZGQ1N2ExMzAwNTljNTIwOGJmNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjJiZDgyY2RkMDMxMDdlMjNkOTYzNjdkZjJhZjM5Njc5YmRkNDNjZjI2ZGI0
10
- N2FlYWQxZTc2Mjg5MThjNjc5NGZjYTIxMmE0ZmQ1ZDYwY2YzOTk0ZGJjZDQy
11
- MDFiODFmYzU0Y2VkNzQyNTYzZGJhNzgxYWY2M2VkMGY2YzY2OTU=
9
+ OWM5MmQxMmEyYWQ4YjEyMDBkOGYzNDZkZGJiYjY1YzNlZjIzNzVmOGNmYmE3
10
+ OGI1MzdkNjc2YjVkN2VhMzllY2Q4M2NlNDAxYmU0ZjFlODZlYTZmYTAyMzc1
11
+ NmFmOTEwOWY0NDY3MjQ1YWM3NzJlNzZjYjEwYzdkNDNhOWZhYWM=
12
12
  data.tar.gz: !binary |-
13
- NmI1ZTE2NjE3MDFmYjk5ZWEyNWQyNjdhYTI0MTc2NjA3ZjFkY2NiMGFhZjZk
14
- NmMyZTFhNGJhOTFlNmMxNGIxMzI1YTQwNTEyMTgwZThiYWU0YjlkYTIxZDVi
15
- ZTM2NGRiNDYyODA0ZmU5MGI4OTNlMzA2YTU3NzU1OTYxNDQ5MDI=
13
+ MjIzMTJiNDBkMzQwMzU5MWIxYzc3Zjc3MWQyZjI5ZDFiYTIyZGM2OTJkN2E3
14
+ ZWQxMGY0MDU5NDM1OTNhZWIzMzYzMDJhNjQwNWY3Y2JlOGVlMjgwZDQzMDBm
15
+ YmJiNmQ2NDQ4NThlNGM2MzE2OWI3ODI1NzUwZDg4M2ZkMDgxNTQ=
data/README.md CHANGED
@@ -18,6 +18,10 @@ Submit a PR, adding a file to `sheets` folder, with the cheat-sheet name.
18
18
 
19
19
  ## Usage
20
20
 
21
+ ### Help
22
+
23
+ $ cheatly help
24
+
21
25
  ### List all cheat sheets
22
26
 
23
27
  $ cheatly list
data/lib/cheatly/sheet.rb CHANGED
@@ -84,12 +84,16 @@ module Cheatly
84
84
  include HTTParty
85
85
  base_uri 'https://api.github.com'
86
86
 
87
+ def headers
88
+ { :headers => {"User-Agent" => "Cheatly Gem"} }
89
+ end
90
+
87
91
  def base_path
88
92
  "/repos/arthurnn/cheatly/contents/sheets"
89
93
  end
90
94
 
91
95
  def find(path)
92
- response = self.class.get("#{base_path}/#{path}.yml")
96
+ response = self.class.get("#{base_path}/#{path}.yml", headers)
93
97
  json = JSON.parse(response.body)
94
98
  sheet_yaml = Base64.decode64(json["content"])
95
99
  yml = YAML.load(sheet_yaml).first
@@ -97,7 +101,7 @@ module Cheatly
97
101
  end
98
102
 
99
103
  def all
100
- response = self.class.get(base_path)
104
+ response = self.class.get(base_path, headers)
101
105
  json = JSON.parse(response.body)
102
106
  json.map { |entry| entry["name"].gsub('.yml', '') }
103
107
  end
@@ -1,3 +1,3 @@
1
1
  module Cheatly
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/cheatly.rb CHANGED
@@ -19,7 +19,7 @@ module Cheatly
19
19
 
20
20
  if "help" == @command
21
21
  @handle = @command
22
- @commands = "show"
22
+ @command = "show"
23
23
  end
24
24
 
25
25
  @options = {}
data/sheets/help.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  ---
2
- help: ! "cheatly help\n------------\nusage: $cheatly list\n To list the available
3
- sheets\n\n $cheatly show (sheetname)\n To see the sheet\n\n $cheatly
2
+ help: ! "cheatly help\n------------\nusage: $ cheatly list\n To list the available
3
+ sheets\n\n $ cheatly show (sheetname)\n To see the sheet\n\n To
4
+ create a new sheet local:\n 1. Clone the project: https://github.com/arthurnn/cheatly\n
5
+ \ 2. $ cheatly new (sheetname)\n 3. Create a PR\n\n $ cheatly
4
6
  help\n To see this\n happy cheating !\n"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheatly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arthur Neves
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-13 00:00:00.000000000 Z
11
+ date: 2013-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty