cheatly 0.0.2 → 0.0.3
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 +8 -8
- data/README.md +7 -2
- data/lib/cheatly/sheet.rb +37 -11
- data/lib/cheatly/version.rb +1 -1
- data/lib/cheatly.rb +44 -2
- data/sheets/assertions.yml +19 -0
- data/sheets/bash.yml +45 -0
- data/sheets/exceptions.yml +10 -0
- data/sheets/migrations.yml +63 -0
- data/sheets/sprintf.yml +11 -0
- data/sheets/status_codes.yml +20 -0
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODNlNjlmZmE3MWEzNzQ0ZGEzNTE1MjdiODNkYTI2YmJkZmRhYTNjYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjM3ODU0M2FiNmNkMDI4YWY4NjgwN2IwOGQ3MDA1ZjYxZDAyY2NkNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjVkMWE2Mzg5Yjk4NjMyNmIxY2VmYTQ5MzIxNWJmZmUzYjkzYzUyMjg1NDlh
|
10
|
+
YWM5NTk2ZGFhMjkyNzc4NGU4ZjA1Nzc3Yzc0YjVmYjVkOTUxMDJhMmFlZDU5
|
11
|
+
ZjllNmZkZTJlOTE0MDJjNjZjYWFiNzAxMjU3OGY1MjRjYzFmYjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTliODk1ZGFhYzgyNjFhOGFmODQ0MDRhNjAyOTU1Y2IwYmUwZDczMTJhNDQ5
|
14
|
+
N2E1NTRjMjFkMmFlMGU5YTc1NmM2ZWM4MTZjYTMzZGRkNDA4NGU5MDY4OTE5
|
15
|
+
NjJmYzA0Y2RhODVlMTA3YzY2ZjQ2NjZhMTdlMTlkZDc3YzExYTc=
|
data/README.md
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
# Cheatly
|
2
2
|
|
3
3
|
This is a command line toolset to handle the cheat-sheets reposity located at [sheets](https://github.com/arthurnn/cheatly/tree/master/sheets) folder.
|
4
|
-
This gem is inspired by https://github.com/defunkt/cheat.
|
5
4
|
|
6
|
-
|
5
|
+
This gem is not a fork but inspired by [defunkt/cheat](https://github.com/defunkt/cheat). However instead of using a full server to store the sheets, it uses github as central repository, making more reliable and easy to add new ones.
|
6
|
+
|
7
|
+
## Help: Adding a new cheat-sheet
|
7
8
|
|
8
9
|
Submit a PR, adding a file to `sheets` folder, with the cheat-sheet name.
|
9
10
|
|
11
|
+
1. Fork it
|
12
|
+
2. `cheatly new name` (replacing name with name of the sheet)
|
13
|
+
3. Create new Pull Request
|
14
|
+
|
10
15
|
## Installation
|
11
16
|
|
12
17
|
$ gem install cheatly
|
data/lib/cheatly/sheet.rb
CHANGED
@@ -6,13 +6,15 @@ module Cheatly
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def to_s
|
9
|
-
"
|
9
|
+
" #{@body.gsub("\r",'').gsub("\n", "\n ")}"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.create(title, body)
|
13
|
+
adapter.create(title, body)
|
10
14
|
end
|
11
15
|
|
12
16
|
def self.find(handle)
|
13
|
-
|
14
|
-
yml = YAML.load(sheet_yaml).first
|
15
|
-
t, b = yml.first, yml.last
|
17
|
+
t, b = adapter.find(handle)
|
16
18
|
Sheet.new(t, b)
|
17
19
|
end
|
18
20
|
|
@@ -22,14 +24,32 @@ module Cheatly
|
|
22
24
|
end
|
23
25
|
|
24
26
|
def self.adapter
|
25
|
-
# @adapter ||= FileAdapter.new
|
26
27
|
@adapter ||= GithubAdapter.new
|
27
28
|
end
|
29
|
+
|
30
|
+
def self.with_file_adapter
|
31
|
+
@adapter = FileAdapter.new
|
32
|
+
self
|
33
|
+
end
|
28
34
|
end
|
29
35
|
|
30
36
|
class FileAdapter
|
31
|
-
def find(
|
32
|
-
|
37
|
+
def find(name)
|
38
|
+
path = "sheets/#{name}.yml"
|
39
|
+
sheet_yaml = File.read(path)
|
40
|
+
yml = YAML.load(sheet_yaml).first
|
41
|
+
[yml.first, yml.last]
|
42
|
+
end
|
43
|
+
|
44
|
+
def all
|
45
|
+
Dir["sheets/*.yml"].map { |f| f.scan(/sheets\/(.*).yml/)[0][0] }
|
46
|
+
end
|
47
|
+
|
48
|
+
def create(name, body)
|
49
|
+
body = {name => body}.to_yaml
|
50
|
+
f = File.new "sheets/#{name}.yml", "w"
|
51
|
+
f.write(body)
|
52
|
+
f.close
|
33
53
|
end
|
34
54
|
end
|
35
55
|
|
@@ -38,19 +58,25 @@ module Cheatly
|
|
38
58
|
base_uri 'https://api.github.com'
|
39
59
|
|
40
60
|
def base_path
|
41
|
-
"/repos/arthurnn/cheatly/contents"
|
61
|
+
"/repos/arthurnn/cheatly/contents/sheets"
|
42
62
|
end
|
43
63
|
|
44
64
|
def find(path)
|
45
|
-
response = self.class.get("#{base_path}/#{path}")
|
65
|
+
response = self.class.get("#{base_path}/#{path}.yml")
|
46
66
|
json = JSON.parse(response.body)
|
47
|
-
Base64.decode64(json["content"])
|
67
|
+
sheet_yaml = Base64.decode64(json["content"])
|
68
|
+
yml = YAML.load(sheet_yaml).first
|
69
|
+
[yml.first, yml.last]
|
48
70
|
end
|
49
71
|
|
50
72
|
def all
|
51
|
-
response = self.class.get(
|
73
|
+
response = self.class.get(base_path)
|
52
74
|
json = JSON.parse(response.body)
|
53
75
|
json.map { |entry| entry["name"].gsub('.yml', '') }
|
54
76
|
end
|
77
|
+
|
78
|
+
def create
|
79
|
+
raise NotImplementedError
|
80
|
+
end
|
55
81
|
end
|
56
82
|
end
|
data/lib/cheatly/version.rb
CHANGED
data/lib/cheatly.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require "base64"
|
2
2
|
require "json"
|
3
|
+
require "tempfile"
|
4
|
+
require "optparse"
|
3
5
|
|
4
6
|
require "httparty"
|
5
7
|
require "pager"
|
@@ -19,17 +21,33 @@ module Cheatly
|
|
19
21
|
@handle = @command
|
20
22
|
@commands = "show"
|
21
23
|
end
|
24
|
+
|
25
|
+
@options = {}
|
26
|
+
op_parser = OptionParser.new do |opts|
|
27
|
+
opts.on("-l", "--local", "Run using local file system") do |v|
|
28
|
+
@options[:local] = v
|
29
|
+
end
|
30
|
+
end
|
31
|
+
op_parser.parse! args
|
32
|
+
end
|
33
|
+
|
34
|
+
def model
|
35
|
+
if @options[:local]
|
36
|
+
Sheet.with_file_adapter
|
37
|
+
else
|
38
|
+
Sheet
|
39
|
+
end
|
22
40
|
end
|
23
41
|
|
24
42
|
def sheet(handle)
|
25
|
-
sheet =
|
43
|
+
sheet = model.find(handle)
|
26
44
|
page
|
27
45
|
puts "#{sheet.title}:"
|
28
46
|
puts sheet.to_s
|
29
47
|
end
|
30
48
|
|
31
49
|
def list
|
32
|
-
sheets =
|
50
|
+
sheets = model.all
|
33
51
|
page
|
34
52
|
puts "List of available cheat-sheets:"
|
35
53
|
sheets.each do |sheet|
|
@@ -37,12 +55,36 @@ module Cheatly
|
|
37
55
|
end
|
38
56
|
end
|
39
57
|
|
58
|
+
def create(handle)
|
59
|
+
body = write_to_tempfile(handle)
|
60
|
+
Sheet.with_file_adapter.create(handle, body)
|
61
|
+
end
|
62
|
+
|
63
|
+
def write_to_tempfile(title, body = nil)
|
64
|
+
# god dammit i hate tempfile, this is so messy but i think it's
|
65
|
+
# the only way.
|
66
|
+
tempfile = Tempfile.new(title + '.yml')
|
67
|
+
tempfile.write(body) if body
|
68
|
+
tempfile.close
|
69
|
+
system "#{editor} #{tempfile.path}"
|
70
|
+
tempfile.open
|
71
|
+
body = tempfile.read
|
72
|
+
tempfile.close
|
73
|
+
body
|
74
|
+
end
|
75
|
+
|
76
|
+
def editor
|
77
|
+
ENV['VISUAL'] || ENV['EDITOR'] || "nano"
|
78
|
+
end
|
79
|
+
|
40
80
|
def process
|
41
81
|
case @command
|
42
82
|
when "show"
|
43
83
|
sheet(@handle)
|
44
84
|
when "list"
|
45
85
|
list
|
86
|
+
when "new"
|
87
|
+
create(@handle)
|
46
88
|
else
|
47
89
|
puts "Command [#{@command}] not found. :-("
|
48
90
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
assertions: ! " # Credit: http://nubyonrails.com/articles/ruby-rails-test-rails-cheat-sheet\n
|
3
|
+
\ # Use 'cheat assert_raise' for more details\n \n # Standard Ruby Assertions\n
|
4
|
+
\ \n assert boolean \n assert_equal expected, actual
|
5
|
+
\n assert_raise *args \n assert_raises *args, &block \n assert_instance_of
|
6
|
+
\ klass, object \n assert_nil object \n assert_kind_of klass,
|
7
|
+
object \n assert_respond_to object, method \n assert_match pattern,
|
8
|
+
string \n assert_same expected, actual \n assert_operator object1,
|
9
|
+
operator, object2 \n assert_nothing_raised *args \n assert_not_same expected,
|
10
|
+
actual \n assert_not_equal expected, actual \n assert_not_nil object
|
11
|
+
\n assert_no_match regexp, string \n assert_throws expected_symbol,
|
12
|
+
&proc \n assert_nothing_thrown &proc \n assert_in_delta expected_float,
|
13
|
+
actual_float, delta \n assert_send send_array\n \n # Rails Assertions\n
|
14
|
+
\ \n assert_response type \n assert_redirected_to options = {} \n assert_template
|
15
|
+
\ expected \n assert_recognizes expected_options, path, extras={}
|
16
|
+
\n assert_generates expected_path, options, defaults={}, extras = {} \n
|
17
|
+
\ assert_routing path, options, defaults={}, extras={} \n assert_tag *opts
|
18
|
+
\n assert_no_tag *opts \n assert_dom_equal expected, actual \n
|
19
|
+
\ assert_dom_not_equal expected, actual \n assert_valid record "
|
data/sheets/bash.yml
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
bash: ! " !! - Last command\n !foo - Run most recent command starting with 'foo...'
|
3
|
+
(ex. !ps, !mysqladmin)\n !foo:p - Print command that !foo would run, and add
|
4
|
+
it as the latest to\n command history\n !$ - Last 'word' of last command ('/path/to/file'
|
5
|
+
in the command 'ls -lAFh\n /path/to/file', '-uroot' in 'mysql -uroot')\n !$:p
|
6
|
+
- Print word that !$ would substitute\n !* - All but first word of last command
|
7
|
+
('-lAFh /path/to/file' in the\n command 'ls -lAFh /path/to/file', '-uroot' in
|
8
|
+
'mysql -uroot')\n !*:p - Print words that !* would substitute\n \n ^foo^bar
|
9
|
+
- Replace 'foo' in last command with 'bar', print the result, then\n run. ('mysqladmni
|
10
|
+
-uroot', run '^ni^in', results in 'mysqladmin -uroot')\n \n {a,b,c} passes words
|
11
|
+
to the command, substituting a, b, and c sequentially\n (`cp file{,.bk}` runs
|
12
|
+
`cp file file.bk`)\n \n Ctrl + a - Jump to the start of the line\n Ctrl +
|
13
|
+
b - Move back a char\n Ctrl + c - Terminate the command\n Ctrl + d - Delete
|
14
|
+
from under the cursor\n Ctrl + e - Jump to the end of the line\n Ctrl + f
|
15
|
+
- Move forward a char\n Ctrl + k - Delete to EOL\n Ctrl + l - Clear the screen\n
|
16
|
+
\ Ctrl + r - Search the history backwards\n Ctrl + R - Search the history backwards
|
17
|
+
with multi occurrence\n Ctrl + t - Transpose the current char with the previous\n
|
18
|
+
\ Ctrl + u - Delete backward from cursor\n Ctrl + w - Delete backward a word\n
|
19
|
+
\ Ctrl + xx - Move between EOL and current cursor position\n Ctrl + x @ - Show
|
20
|
+
possible hostname completions\n Ctrl + z - Suspend/ Stop the command\n Ctrl
|
21
|
+
+ x; Ctrl + e - Edit line into your favorite editor\n \n Alt + < - Move to the
|
22
|
+
first line in the history\n Alt + > - Move to the last line in the history\n
|
23
|
+
\ Alt + ? - Show current completion list\n Alt + * - Insert all possible completions\n
|
24
|
+
\ Alt + / - Attempt to complete filename\n Alt + . - Yank last argument to
|
25
|
+
previous command\n Alt + b - Move backward\n Alt + c - Capitalize the word\n
|
26
|
+
\ Alt + d - Delete word\n Alt + f - Move forward\n Alt + l - Make word lowercase\n
|
27
|
+
\ Alt + n - Search the history forwards non-incremental\n Alt + p - Search
|
28
|
+
the history backwards non-incremental\n Alt + r - Recall command\n Alt + t
|
29
|
+
- Transpose the current word with the previous\n Alt + u - Make word uppercase\n
|
30
|
+
\ Alt + back-space - Delete backward from cursor\n \n (Here \"2T\" means Press
|
31
|
+
TAB twice)\n $ 2T - All available commands(common)\n $ (string)2T - All available
|
32
|
+
commands starting with (string)\n $ /2T - Entire directory structure including
|
33
|
+
Hidden one\n $ (dir)2T - Only Sub Dirs inside (dir) including Hidden one\n $
|
34
|
+
*2T - Only Sub Dirs inside without Hidden one \n $ ~2T - All Present Users on
|
35
|
+
system from \"/etc/passwd\"\n $ $2T - All Sys variables\n $ @2T - Entries
|
36
|
+
from \"/etc/hosts\"\n $ =2T - Output like ls or dir\n .bash_profile = sourced
|
37
|
+
by login shell, \n .bashrc = sourced by all shells, \n .bash_aliases = should
|
38
|
+
be sourced by .bashrc\n \n Run something:\n for i in a b c; do $i 'hello';
|
39
|
+
done\n \n Do something on a bunch of files:\n for i in *.rb; do echo \"$i\";
|
40
|
+
done\n \n If syntax:\n if [[ -e .ssh ]]; then echo \"hi\"; fi\n \n Numerical
|
41
|
+
comparison:\n i=0; if (( i <= 1 )); then echo \"smaller or equal\"; else echo
|
42
|
+
\"bigger\"; fi\n \n file check flags:\n -e: file exists\n -f: regular
|
43
|
+
file (non directory)\n -d: directory\n -s: non-zero file\n -x: execute
|
44
|
+
permission\n \n Avoid duplicates in your history:\n export HISTIGNORE=\"&:ls:ls
|
45
|
+
*:[bf]g:exit\"\n \n more here:\n \n http://www.linuxtopia.org/online_books/advanced_bash_scripting_guide/fto.html"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
exceptions: ! " Exception\r\n NoMemoryError\r\n ScriptError\r\n LoadError\r\n NotImplementedError\r\n
|
3
|
+
\ SyntaxError\r\n SignalException\r\n Interrupt\r\n Timeout::Error #
|
4
|
+
require 'timeout' for Timeout::Error\r\n StandardError # caught by rescue
|
5
|
+
if no type is specified\r\n ArgumentError\r\n IOError\r\n EOFError\r\n IndexError\r\n
|
6
|
+
\ LocalJumpError\r\n NameError\r\n NoMethodError\r\n RangeError\r\n FloatDomainError\r\n
|
7
|
+
\ RegexpError\r\n RuntimeError\r\n Timeout::Error # moved here in ruby
|
8
|
+
1.9.2\r\n SecurityError\r\n SocketError\r\n SystemCallError # Errno::*
|
9
|
+
inherits here\r\n SystemStackError\r\n ThreadError\r\n TypeError\r\n ZeroDivisionError\r\n
|
10
|
+
\ SystemExit\r\n fatal"
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
migrations: ! " Methods:\n create_table(name, options)\n drop_table(name)\n
|
3
|
+
\ rename_table(old_name, new_name)\n add_column(table_name, column_name, type,
|
4
|
+
options)\n rename_column(table_name, column_name, new_column_name)\n change_column(table_name,
|
5
|
+
column_name, type, options)\n remove_column(table_name, column_name)\n add_index(table_name,
|
6
|
+
column_name, index_type)\n remove_index(table_name, column_name)\n change_table(table_name)
|
7
|
+
{|Table.new(table_name, self)| ...} \n \n Available Column Types (mappings are
|
8
|
+
below):\n * integer\n * float\n * datetime\n * date\n * timestamp\n
|
9
|
+
\ * time\n * text\n * string\n * binary\n * boolean\n * decimal
|
10
|
+
:precision, :scale\n \n Valid Column Options:\n * limit\n * null (i.e. \":null
|
11
|
+
=> false\" implies NOT NULL)\n * default (to specify default values)\n * :decimal,
|
12
|
+
:precision => 8, :scale => 3\n \n Rake Tasks:\n rake db:schema:dump: run after
|
13
|
+
you create a model to capture the schema.rb\n rake db:schema:import: import the
|
14
|
+
schema file into the current database (on\n error, check if your schema.rb has
|
15
|
+
\":force => true\" on the create table\n statements\n ./script/generate migration
|
16
|
+
MigrationName: generate a new migration with a\n new 'highest' version (run './script/generate
|
17
|
+
migration' for this info at\n your fingertips)\n rake db:migrate: migrate
|
18
|
+
your current database to the most recent version\n rake db:migrate VERSION=5:
|
19
|
+
migrate your current database to a specific\n version (in this case, version
|
20
|
+
5)\n rake db:rollback: migrate down one migration\n rake db:rollback STEP=3:
|
21
|
+
migrate down three migrations\n rake db:migrate RAILS_ENV=production: migrate
|
22
|
+
your production database\n \n SQL:\n Queries can be executed directly:\n execute
|
23
|
+
'ALTER TABLE researchers ADD CONSTRAINT fk_researchers_departments\n FOREIGN
|
24
|
+
KEY ( department_id ) REFERENCES departments( id )'\n \n Example Migration:\n
|
25
|
+
\ class UpdateUsersAndCreateProducts < ActiveRecord::Migration\n def self.up\n
|
26
|
+
\ rename_column \"users\", \"password\", \"hashed_password\" \n remove_column
|
27
|
+
\"users\", \"email\" \n \n User.reset_column_information\n User.find(:all).each{|u|
|
28
|
+
#do something with u}\n \n create_table \"products\", :force => true do
|
29
|
+
|t|\n t.column \"name\", :text\n t.column \"description\", :text\n
|
30
|
+
\ t.column \"price\", :decimal, :precision => 9, :scale => 2\n t.column
|
31
|
+
\"category_id\", :integer\n end\n \n #the rails 2.0 way:\n create_table
|
32
|
+
:people do |t|\n t.integer :account_id\n t.string :first_name,
|
33
|
+
:last_name, :null => false\n t.text :description\n t.references
|
34
|
+
:category # is the equivalent of t.integer :category_id\n t.timestamps\n
|
35
|
+
\ end\n end\n \n def self.down\n rename_column \"users\",
|
36
|
+
\"hashed_password\", \"password\" \n add_column \"users\", \"email\", :string\n
|
37
|
+
\ drop_table \"products\" \n end\n end\n \n Find Highest version:\n
|
38
|
+
\ script/runner \"puts ActiveRecord::Migrator.current_version\"\n \n Database
|
39
|
+
Mapping\n \n Rails | db2 | mysql | openbase | Oracle
|
40
|
+
\ |\n --- | --- | --- | --- | --- |\n
|
41
|
+
\ :binary | blob(32678) | blob | object | blob |\n :boolean
|
42
|
+
\ | decimal(1) | tinyint(1) | boolean | number(10) |\n :date |
|
43
|
+
date | date | date | date |\n :datetime | timestamp
|
44
|
+
\ | datetime | datetime | date |\n :decimal | decimal |
|
45
|
+
decimal | decimal | decimal |\n :float | float | float
|
46
|
+
\ | float | number |\n :integer | int | int(11)
|
47
|
+
\ | integer | number(38) |\n :string | varchar(255) | varchar(255)
|
48
|
+
| char(4096) | varchar2(255) |\n :text | clob(32768) | text | text
|
49
|
+
\ | clob |\n :time | time | time | time |
|
50
|
+
date |\n :timestamp | timestamp | datetime | timestamp | date
|
51
|
+
\ |\n \n Rails | postgresql | sqlite | sqlserver | Sybase
|
52
|
+
\ |\n --- | --- | --- | --- | --- |\n
|
53
|
+
\ :binary | bytea | blob | image | image |\n :boolean
|
54
|
+
\ | boolean | boolean | bit | bit |\n :date |
|
55
|
+
date | date | datetime | datetime |\n :datetime | timestamp
|
56
|
+
\ | datetime | datetime | datetime |\n :decimal | decimal |
|
57
|
+
decimal | decimal | decimal |\n :float | float | float
|
58
|
+
\ | float(8) | float(8) |\n :integer | integer | integer
|
59
|
+
\ | int | int |\n :string | * | varchar(255)
|
60
|
+
| varchar(255) | varchar(255) |\n :text | text | text | text
|
61
|
+
\ | text |\n :time | time | datetime | datetime
|
62
|
+
\ | time |\n :timestamp | timestamp | datetime | datetime |
|
63
|
+
timestamp |"
|
data/sheets/sprintf.yml
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
sprintf: ! " %b => Binary integer\n %c => Single character\n %d => Decimal
|
3
|
+
integer\n %e => Decimal integer displayed in exponential form (3e+07)\n %E
|
4
|
+
\ => Decimal integer displayed in exponential form (3E+07)\n %f => Floating
|
5
|
+
point number\n %g => Same as %e if exponent is less than -4, %f otherwise\n %G
|
6
|
+
\ => Same as %E if exponent is less than -4, %f otherwise\n %o => Octal
|
7
|
+
integer\n %s => String\n %u => Unsigned decimal integer\n %x => Hexadecimal
|
8
|
+
integer (2a)\n %X => Hexadecimal integer uppercase (2A)\n %02d => 0 padded
|
9
|
+
two digits\n %.02f => round to the hundredths\n %+ => +/- sign\n \n width
|
10
|
+
& alignment\n \"%10s\" % \"hello\" => \" hello\" \n \"%-10s\" % \"hello\"
|
11
|
+
=> \"hello \""
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
status_codes: ! " Use these codes for the #head or #render methods. ex:\n head
|
3
|
+
:ok\n render :file => '404.html.erb', :status => :not_found\n \n 1xx Informational\n
|
4
|
+
\ \n 100 => :continue\n 101 => :switching_protocols\n 102 => :processing\n \n
|
5
|
+
\ 2xx Success\n \n 200 => :ok\n 201 => :created\n 202 => :accepted\n 203 =>
|
6
|
+
:non_authoritative_information\n 204 => :no_content\n 205 => :reset_content\n
|
7
|
+
\ 206 => :partial_content\n 207 => :multi_status\n 226 => :im_used\n \n 3xx
|
8
|
+
Redirection\n \n 300 => :multiple_choices\n 301 => :moved_permanently\n 302
|
9
|
+
=> :found\n 303 => :see_other\n 304 => :not_modified\n 305 => :use_proxy\n 307
|
10
|
+
=> :temporary_redirect\n \n 4xx Client Error\n \n 400 => :bad_request\n 401
|
11
|
+
=> :unauthorized\n 402 => :payment_required\n 403 => :forbidden\n 404 => :not_found\n
|
12
|
+
\ 405 => :method_not_allowed\n 406 => :not_acceptable\n 407 => :proxy_authentication_required\n
|
13
|
+
\ 408 => :request_timeout\n 409 => :conflict\n 410 => :gone\n 411 => :length_required\n
|
14
|
+
\ 412 => :precondition_failed\n 413 => :request_entity_too_large\n 414 => :request_uri_too_long\n
|
15
|
+
\ 415 => :unsupported_media_type\n 416 => :requested_range_not_satisfiable\n 417
|
16
|
+
=> :expectation_failed\n 422 => :unprocessable_entity\n 423 => :locked\n 424
|
17
|
+
=> :failed_dependency\n 426 => :upgrade_required\n \n 5xx Server Error\n \n
|
18
|
+
\ 500 => :internal_server_error\n 501 => :not_implemented\n 502 => :bad_gateway\n
|
19
|
+
\ 503 => :service_unavailable\n 504 => :gateway_timeout\n 505 => :http_version_not_supported\n
|
20
|
+
\ 507 => :insufficient_storage\n 510 => :not_extended"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cheatly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arthur Neves
|
@@ -84,7 +84,13 @@ files:
|
|
84
84
|
- lib/cheatly.rb
|
85
85
|
- lib/cheatly/sheet.rb
|
86
86
|
- lib/cheatly/version.rb
|
87
|
+
- sheets/assertions.yml
|
88
|
+
- sheets/bash.yml
|
89
|
+
- sheets/exceptions.yml
|
87
90
|
- sheets/gem_release.yml
|
91
|
+
- sheets/migrations.yml
|
92
|
+
- sheets/sprintf.yml
|
93
|
+
- sheets/status_codes.yml
|
88
94
|
- sheets/strftime.yml
|
89
95
|
homepage: ''
|
90
96
|
licenses:
|