/
index.html
155 lines (134 loc) · 9.04 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<html>
<head>
<meta charset="utf-8">
<title>GemSpec CheatSheet</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le styles -->
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
<style type="text/css">
body { padding-top: 20px; }
pre { line-height: 1.8em; }
a:hover, .nav a:hover { color: #0069D6; text-decoration: underline; }
.pair { padding: 2px 5px; }
.pair:hover { background-color: #DA4F49; color: white; border-radius: 3px;}
#hint {
position:absolute;
top:90px;
width:400px;
}
#hint, #hint p { font-size: 20px; line-height: 28px; }
</style>
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
<script type="text/javascript">
var hints = {
"author": {"summary": "The author or authors of the package contained in the gem."},
"authors": {"summary": "The author or authors of the package contained in the gem."},
"autorequire": {"summary": "<strong>Deprecated</strong> The file that will be loaded when the gem method is called."},
"bindir": {"summary": "The directory containing the application files, if any."},
"date": {"summary": "The date/time that the gem was created."},
"default_executable": {"summary": "Of all the application files in the package, the default executable is the one that can be run directly through the gem."},
"dependencies": {"summary": "Lists the gems that must be installed for this gem to work."},
"add_dependency": {"summary": "Adds a gem to the dependencies list. These are the gems that must be installed for this gem to work."},
"development dependencies": {"summary": "Gems that are used for development purposes only."},
"add_development_dependency": {"summary": "Adds a gem to the development dependencies list. These gems are used for development purposes only."},
"description": {"summary": "Detailed description of the gem."},
"email": {"summary": "The author’s email address."},
"executables": {"summary": "A list of files in the package that are applications."},
"extensions": {"summary": "The paths to extconf.rb-style files used to compile extensions."},
"extra_rdoc_files": {"summary": "A list of extra files that will be used by RDoc to generate the documentation."},
"files": {"summary": "The list of files to be contained in the gem."},
"has_rdoc": {"summary": "Indicates whether the code in the gem has been commented with RDoc in mind."},
"homepage": {"summary": "URL of the project or author."},
"license": {"summary": "The license(s) for the library."},
"licenses": {"summary": "The license(s) for the library."},
"name": {"summary": "The name of the gem."},
"platform": {"summary": "The target platform for the gem."},
"rdoc_options": {"summary": "Specifies the rdoc options to be used when generating API documentation"},
"require_path": {"summary": "List of \"require\" paths from the root of the gem."},
"require_paths": {"summary": "List of \"require\" paths from the root of the gem."},
"required_ruby_version": {"summary": "The version of Ruby required to use the gem."},
"required_rubygems_version": {"summary": "The version of RubyGems required to use the gem."},
"requirements": {"summary": "Lists the external (to RubyGems) requirements that must be met for this gem to work. It's simply information for the user."},
"rubyforge_project": {"summary": "The RubyForge project corresponding to the gem."},
"rubygems_version": {"summary": "The version of RubyGems used to create this gem."},
"specification_version": {"summary": "The revision level of the GemSpec specification that this gem conforms to."},
"summary": {"summary": "A short description of the gem."},
"test_files": {"summary": "A collection of unit test files. They will be loaded as unit tests when the user requests a gem to be unit tested."},
"version": {"summary": "The version of the gem. See RationalVersioningPolicy for some advice on specifying the version number for your gem."}
}
$(document).ready(function(){
$('.pair').mouseover(function(e){
var el = this;
console.log($(document).scrollTop() + (90) + "px");
$('#hint').css('top', $(document).scrollTop() + (90) + 'px');
var key = $('.key', el).html().replace(/"/g, '');
$('#hint').html(hints[key]["summary"]);
$('#hint').prepend("<h1>" + key + "</h1>");
});
});
</script>
</head>
<body>
<a href="https://github.com/excid3/gemspec-cheatsheet"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/71eeaab9d563c2b3c590319b398dd35683265e85/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub"></a>
<div class="container">
<div id="header">
<div class="pull-right">
<ul class="nav">
<li><a href="http://rubygems.org">RubyGems.org</a></li>
<li><a href="http://docs.rubygems.org/read/chapter/20">GemSpec Docs</a></li>
</ul>
</div>
<h1><a href="#">GemSpec CheatSheet</a></h1>
</div>
<div class="row">
<div class="span10">
<pre>Gem::Specification.new do |s|
<span class="pair">s.<span class="key">platform</span> = Gem::Platform::RUBY</span>
<span class="pair">s.<span class="key">name</span> = 'example'</span>
<span class="pair">s.<span class="key">rubyforge_project</span> = 'example'</span>
<span class="pair">s.<span class="key">version</span> = '0.4.1'</span>
<span class="pair">s.<span class="key">summary</span> = 'An example gem.'</span>
<span class="pair">s.<span class="key">description</span> = 'An example gem with many gemspec options.'</span>
<span class="pair">s.<span class="key">requirements</span> = 'A powerful graphics card.'</span>
<span class="pair">s.<span class="key">required_ruby_version</span> = '>= 1.9.3'</span>
<span class="pair">s.<span class="key">required_rubygems_version</span> = '>= 1.8.11'</span>
<span class="pair">s.<span class="key">author</span> = 'John Jones'</span>
<span class="pair">s.<span class="key">authors</span> = ['John Jones', 'Mary Smith']</span>
<span class="pair">s.<span class="key">email</span> = 'david@loudthinking.com'</span>
<span class="pair">s.<span class="key">homepage</span> = 'http://www.rubyonrails.org'</span>
<span class="pair">s.<span class="key">license</span> = 'MIT'</span>
<span class="pair">s.<span class="key">licenses</span> = ['MIT', 'GPL-2']</span>
<span class="pair">s.<span class="key">has_rdoc</span> = true</span>
<span class="pair">s.<span class="key">rdoc_options</span> << '--line-numbers'</span>
<span class="pair">s.<span class="key">extra_rdoc_files</span> = ['README', 'doc/user-guide.txt']</span>
<span class="pair">s.<span class="key">bindir</span> = 'bin'</span>
<span class="pair">s.<span class="key">executables</span> = ['bin/foo', 'bin/bar']</span>
<span class="pair">s.<span class="key">default_executable</span> = 'bin/bar'</span>
<span class="pair">s.<span class="key">require_path</span> = '.'</span>
<span class="pair">s.<span class="key">require_paths</span> << 'ext'</span>
<span class="pair">s.<span class="key">files</span> = FileList['lib/**/*.rb', 'test/**/*'].to_a</span>
<span class="pair">s.<span class="key">test_files</span> = Dir.glob('test/tc_*.rb')</span>
<span class="pair">s.<span class="key">add_dependency</span> 'bundler', '~> 1.1'</span>
<span class="pair">s.<span class="key">add_development_dependency</span> 'rspec'</span>
<span class="pair">s.<span class="key">extensions</span> << 'ext/rmagic/extconf.rb'</span>
end</pre>
</div>
<div id="hint" class="offset10 span5">
<p>This is an interactive guide for exploring various important properties of the gemspec packaging format for Ruby gems.</p>
<p>You can access information about properties by mousing over them.</p>
</div>
</div>
<footer>
<p class="pull-right">Built by <a href="http://excid3.com">Chris Oliver</a> | <a href="http://twitter.com/excid3">@excid3</a></p>
</footer>
</div>
</body>
</html>