strawberry_api 0.1.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 +7 -0
- data/.gitignore +9 -0
- data/.rubocop.yml +4 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +135 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/HTTParty/Response.html +148 -0
- data/doc/StrawberryAPI/AccessRight.html +431 -0
- data/doc/StrawberryAPI/ApiKey.html +637 -0
- data/doc/StrawberryAPI/ArchiveStrategy.html +365 -0
- data/doc/StrawberryAPI/ArchiveStrategyState.html +1057 -0
- data/doc/StrawberryAPI/Asset.html +1791 -0
- data/doc/StrawberryAPI/AssetCopyToStrategy.html +145 -0
- data/doc/StrawberryAPI/AssetFeedback.html +370 -0
- data/doc/StrawberryAPI/Client/ApiKeys.html +904 -0
- data/doc/StrawberryAPI/Client/ArchiveStrategies.html +784 -0
- data/doc/StrawberryAPI/Client/AssetCopyToStrategies.html +805 -0
- data/doc/StrawberryAPI/Client/AssetFeedbacks.html +232 -0
- data/doc/StrawberryAPI/Client/Assets.html +888 -0
- data/doc/StrawberryAPI/Client/Collections.html +319 -0
- data/doc/StrawberryAPI/Client/CopyToFeedbacks.html +232 -0
- data/doc/StrawberryAPI/Client/CustomMetadata.html +210 -0
- data/doc/StrawberryAPI/Client/CustomMetadataFields.html +214 -0
- data/doc/StrawberryAPI/Client/CustomMetadataOptions.html +214 -0
- data/doc/StrawberryAPI/Client/CustomMetadataSets.html +214 -0
- data/doc/StrawberryAPI/Client/Edits.html +485 -0
- data/doc/StrawberryAPI/Client/Features.html +319 -0
- data/doc/StrawberryAPI/Client/Libraries.html +321 -0
- data/doc/StrawberryAPI/Client/Markers.html +234 -0
- data/doc/StrawberryAPI/Client/ProjectCopyToStrategies.html +857 -0
- data/doc/StrawberryAPI/Client/ProjectFeedbacks.html +232 -0
- data/doc/StrawberryAPI/Client/Projects.html +2764 -0
- data/doc/StrawberryAPI/Client/Roles.html +214 -0
- data/doc/StrawberryAPI/Client/Schedules.html +319 -0
- data/doc/StrawberryAPI/Client/Searches.html +293 -0
- data/doc/StrawberryAPI/Client/Sessions.html +376 -0
- data/doc/StrawberryAPI/Client/Settings.html +210 -0
- data/doc/StrawberryAPI/Client/StatusFlags.html +315 -0
- data/doc/StrawberryAPI/Client/Teams.html +1067 -0
- data/doc/StrawberryAPI/Client/Templates.html +319 -0
- data/doc/StrawberryAPI/Client/Users.html +1255 -0
- data/doc/StrawberryAPI/Client.html +487 -0
- data/doc/StrawberryAPI/Collection.html +427 -0
- data/doc/StrawberryAPI/Configuration.html +481 -0
- data/doc/StrawberryAPI/CopyToFeedback.html +220 -0
- data/doc/StrawberryAPI/CustomMetadataField.html +999 -0
- data/doc/StrawberryAPI/CustomMetadataOption.html +567 -0
- data/doc/StrawberryAPI/CustomMetadataSet.html +649 -0
- data/doc/StrawberryAPI/CustomMetadatum.html +718 -0
- data/doc/StrawberryAPI/Edit.html +637 -0
- data/doc/StrawberryAPI/Feature.html +567 -0
- data/doc/StrawberryAPI/Feedback.html +641 -0
- data/doc/StrawberryAPI/HttpClient.html +971 -0
- data/doc/StrawberryAPI/Library.html +637 -0
- data/doc/StrawberryAPI/Marker.html +847 -0
- data/doc/StrawberryAPI/Project.html +2395 -0
- data/doc/StrawberryAPI/ProjectCopyToStrategy.html +365 -0
- data/doc/StrawberryAPI/ProjectFeedback.html +370 -0
- data/doc/StrawberryAPI/Proxy.html +1267 -0
- data/doc/StrawberryAPI/Role.html +567 -0
- data/doc/StrawberryAPI/Schedule.html +2387 -0
- data/doc/StrawberryAPI/Session.html +121 -0
- data/doc/StrawberryAPI/Setting.html +207 -0
- data/doc/StrawberryAPI/StatusFlag.html +207 -0
- data/doc/StrawberryAPI/Strategy.html +641 -0
- data/doc/StrawberryAPI/Team.html +789 -0
- data/doc/StrawberryAPI/Template.html +707 -0
- data/doc/StrawberryAPI/User.html +999 -0
- data/doc/StrawberryAPI.html +483 -0
- data/doc/_index.html +632 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +222 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +222 -0
- data/doc/js/app.js +292 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +3059 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/strawberry_api/access_right.rb +18 -0
- data/lib/strawberry_api/api_key.rb +19 -0
- data/lib/strawberry_api/asset.rb +51 -0
- data/lib/strawberry_api/client/api_keys.rb +49 -0
- data/lib/strawberry_api/client/archive_strategies.rb +87 -0
- data/lib/strawberry_api/client/asset_copy_to_strategies.rb +83 -0
- data/lib/strawberry_api/client/asset_feedbacks.rb +18 -0
- data/lib/strawberry_api/client/assets.rb +92 -0
- data/lib/strawberry_api/client/collections.rb +29 -0
- data/lib/strawberry_api/client/copy_to_feedbacks.rb +18 -0
- data/lib/strawberry_api/client/custom_metadata.rb +16 -0
- data/lib/strawberry_api/client/custom_metadata_fields.rb +18 -0
- data/lib/strawberry_api/client/custom_metadata_options.rb +18 -0
- data/lib/strawberry_api/client/custom_metadata_sets.rb +18 -0
- data/lib/strawberry_api/client/edits.rb +47 -0
- data/lib/strawberry_api/client/features.rb +29 -0
- data/lib/strawberry_api/client/libraries.rb +30 -0
- data/lib/strawberry_api/client/markers.rb +19 -0
- data/lib/strawberry_api/client/project_copy_to_strategies.rb +88 -0
- data/lib/strawberry_api/client/project_feedbacks.rb +18 -0
- data/lib/strawberry_api/client/projects.rb +305 -0
- data/lib/strawberry_api/client/roles.rb +18 -0
- data/lib/strawberry_api/client/schedules.rb +29 -0
- data/lib/strawberry_api/client/searches.rb +25 -0
- data/lib/strawberry_api/client/sessions.rb +33 -0
- data/lib/strawberry_api/client/settings.rb +16 -0
- data/lib/strawberry_api/client/status_flags.rb +27 -0
- data/lib/strawberry_api/client/teams.rb +107 -0
- data/lib/strawberry_api/client/templates.rb +29 -0
- data/lib/strawberry_api/client/users.rb +125 -0
- data/lib/strawberry_api/client.rb +95 -0
- data/lib/strawberry_api/collection.rb +16 -0
- data/lib/strawberry_api/configuration.rb +19 -0
- data/lib/strawberry_api/custom_metadata/custom_metadata_field.rb +30 -0
- data/lib/strawberry_api/custom_metadata/custom_metadata_option.rb +18 -0
- data/lib/strawberry_api/custom_metadata/custom_metadata_set.rb +25 -0
- data/lib/strawberry_api/custom_metadatum.rb +30 -0
- data/lib/strawberry_api/edit.rb +19 -0
- data/lib/strawberry_api/feature.rb +18 -0
- data/lib/strawberry_api/feedback/asset_feedback.rb +15 -0
- data/lib/strawberry_api/feedback/copy_to_feedback.rb +12 -0
- data/lib/strawberry_api/feedback/project_feedback.rb +15 -0
- data/lib/strawberry_api/feedback.rb +19 -0
- data/lib/strawberry_api/http_client.rb +135 -0
- data/lib/strawberry_api/library.rb +19 -0
- data/lib/strawberry_api/marker.rb +22 -0
- data/lib/strawberry_api/project.rb +48 -0
- data/lib/strawberry_api/proxy.rb +28 -0
- data/lib/strawberry_api/role.rb +18 -0
- data/lib/strawberry_api/schedule.rb +44 -0
- data/lib/strawberry_api/session.rb +7 -0
- data/lib/strawberry_api/setting.rb +12 -0
- data/lib/strawberry_api/status_flag.rb +12 -0
- data/lib/strawberry_api/strategy/archive_strategy.rb +10 -0
- data/lib/strawberry_api/strategy/archive_strategy_state.rb +25 -0
- data/lib/strawberry_api/strategy/asset_copy_to_strategy.rb +6 -0
- data/lib/strawberry_api/strategy/project_copy_to_strategy.rb +9 -0
- data/lib/strawberry_api/strategy.rb +19 -0
- data/lib/strawberry_api/team.rb +27 -0
- data/lib/strawberry_api/template.rb +20 -0
- data/lib/strawberry_api/user.rb +30 -0
- data/lib/strawberry_api/version.rb +3 -0
- data/lib/strawberry_api.rb +36 -0
- data/samples/README.md +14 -0
- data/samples/list_assets_links.rb +15 -0
- data/samples/list_projects.rb +14 -0
- data/samples/login.rb +18 -0
- data/samples/test.rb +12 -0
- data/strawberry_api.gemspec +40 -0
- metadata +242 -0
@@ -0,0 +1,222 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
File: README
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.16
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "README";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="file_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index</a> »
|
40
|
+
<span class="title">File: README</span>
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div id="search">
|
45
|
+
|
46
|
+
<a class="full_list_link" id="class_list_link"
|
47
|
+
href="class_list.html">
|
48
|
+
|
49
|
+
<svg width="24" height="24">
|
50
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
51
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
52
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
</svg>
|
54
|
+
</a>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
<div class="clear"></div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div id="content"><div id='filecontents'>
|
61
|
+
<h1 id="label-Strawberry">Strawberry</h1>
|
62
|
+
|
63
|
+
<p>A simple Ruby gem acting as a client for <a
|
64
|
+
href="http://www.flavoursys.com">Flavoursys Strawberry</a> REST API.</p>
|
65
|
+
|
66
|
+
<p>This unofficial implementation covers most of the features offered by
|
67
|
+
Strawberry API.</p>
|
68
|
+
|
69
|
+
<h2 id="label-Installation">Installation</h2>
|
70
|
+
|
71
|
+
<p>Add this line to your application's Gemfile:</p>
|
72
|
+
|
73
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>strawberry_api</span><span class='tstring_end'>'</span></span>
|
74
|
+
</code></pre>
|
75
|
+
|
76
|
+
<p>And then execute:</p>
|
77
|
+
|
78
|
+
<pre class="code ruby"><code class="ruby">$ bundle
|
79
|
+
</code></pre>
|
80
|
+
|
81
|
+
<p>Or install it yourself as:</p>
|
82
|
+
|
83
|
+
<pre class="code ruby"><code class="ruby">$ gem install strawberry_api
|
84
|
+
</code></pre>
|
85
|
+
|
86
|
+
<h2 id="label-Usage">Usage</h2>
|
87
|
+
|
88
|
+
<h3 id="label-Authentication">Authentication</h3>
|
89
|
+
|
90
|
+
<p>Authenticate to the server via regular credentials or by using an API key.
|
91
|
+
A standard error will be raised if authentication fails.</p>
|
92
|
+
|
93
|
+
<h4 id="label-API+key+based+authentication">API key based authentication</h4>
|
94
|
+
|
95
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>strawberry_api</span><span class='tstring_end'>'</span></span>
|
96
|
+
|
97
|
+
<span class='const'><span class='object_link'><a href="StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="StrawberryAPI.html#configure-class_method" title="StrawberryAPI.configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
|
98
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>server_IP_or_hostname</span><span class='tstring_end'>'</span></span>
|
99
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_api_key'>api_key</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>api_key</span><span class='tstring_end'>'</span></span>
|
100
|
+
<span class='kw'>end</span>
|
101
|
+
|
102
|
+
<span class='id identifier rubyid_strawberry'>strawberry</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="StrawberryAPI/Client.html" title="StrawberryAPI::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="StrawberryAPI/HttpClient.html#initialize-instance_method" title="StrawberryAPI::HttpClient#initialize (method)">new</a></span></span>
|
103
|
+
|
104
|
+
<span class='comment'># Returns currently logged in user info
|
105
|
+
</span><span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span>
|
106
|
+
<span class='comment'># => "#<Strawberry::API::User: id=2, username="api", ...
|
107
|
+
</span></code></pre>
|
108
|
+
|
109
|
+
<h4 id="label-User+credentials+based+authentication">User credentials based authentication</h4>
|
110
|
+
|
111
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>strawberry_api</span><span class='tstring_end'>'</span></span>
|
112
|
+
|
113
|
+
<span class='const'><span class='object_link'><a href="StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="StrawberryAPI.html#configure-class_method" title="StrawberryAPI.configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
|
114
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>server_IP_or_hostname</span><span class='tstring_end'>'</span></span>
|
115
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_username'>username</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>username</span><span class='tstring_end'>'</span></span>
|
116
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_password'>password</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>password</span><span class='tstring_end'>'</span></span>
|
117
|
+
<span class='kw'>end</span>
|
118
|
+
|
119
|
+
<span class='id identifier rubyid_strawberry'>strawberry</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="StrawberryAPI/Client.html" title="StrawberryAPI::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="StrawberryAPI/HttpClient.html#initialize-instance_method" title="StrawberryAPI::HttpClient#initialize (method)">new</a></span></span>
|
120
|
+
|
121
|
+
<span class='comment'># Returns currently logged in user info
|
122
|
+
</span><span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span>
|
123
|
+
<span class='comment'># => "#<Strawberry::API::User: id=2, username="api", ...
|
124
|
+
</span></code></pre>
|
125
|
+
|
126
|
+
<h3 id="label-Making+requests">Making requests</h3>
|
127
|
+
|
128
|
+
<h4 id="label-Strawberry+API+client">Strawberry API client</h4>
|
129
|
+
|
130
|
+
<p><a href="doc/Strawberry/Client.html">API methods</a> are available as
|
131
|
+
client instance methods.</p>
|
132
|
+
|
133
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_strawberry'>strawberry</span> <span class='op'>=</span> <span class='const'>Strawberry</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
134
|
+
|
135
|
+
<span class='comment'># Returns all Strawberry projects
|
136
|
+
</span><span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_projects'>projects</span>
|
137
|
+
<span class='comment'># => [#<Strawberry::API::Project: id=6, name="test_project", ...
|
138
|
+
</span></code></pre>
|
139
|
+
|
140
|
+
<h3 id="label-Samples">Samples</h3>
|
141
|
+
|
142
|
+
<p>Most API methods return an object which provide dot notation access for
|
143
|
+
fields returned in the API response.</p>
|
144
|
+
|
145
|
+
<p>See the <a href="samples">samples</a> directory for more examples.</p>
|
146
|
+
|
147
|
+
<h4 id="label-Methods+returning+an+object">Methods returning an object</h4>
|
148
|
+
|
149
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_project'>project</span><span class='lparen'>(</span><span class='label'>id:</span> <span class='int'>6</span><span class='rparen'>)</span>
|
150
|
+
<span class='comment'># => #<Strawberry::API::Project: id=6, name="test_project", ...
|
151
|
+
</span></code></pre>
|
152
|
+
|
153
|
+
<h4 id="label-Methods+returning+an+array+of+project+objects">Methods returning an array of project objects</h4>
|
154
|
+
|
155
|
+
<p>Some methods return an array of objects .</p>
|
156
|
+
|
157
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_projects'>projects</span>
|
158
|
+
<span class='comment'># => [#<Strawberry::API::Project: id=6, name="test_project", ...
|
159
|
+
</span></code></pre>
|
160
|
+
|
161
|
+
<h4 id="label-Methods+returning+a+Boolean">Methods returning a Boolean</h4>
|
162
|
+
|
163
|
+
<p>A few other methods return a Boolean. The following example uses the
|
164
|
+
<code>video?</code> method which indicates whether the asset is a video or
|
165
|
+
not.</p>
|
166
|
+
|
167
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_assets'>assets</span> <span class='op'>=</span> <span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_assets'>assets</span>
|
168
|
+
<span class='comment'># => [#<Strawberry::API::Asset: id=6, name="test_asset", ...
|
169
|
+
</span>
|
170
|
+
<span class='id identifier rubyid_assets'>assets</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_asset'>asset</span><span class='op'>|</span>
|
171
|
+
<span class='comment'># Returns true of false
|
172
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_asset'>asset</span><span class='period'>.</span><span class='id identifier rubyid_video?'>video?</span>
|
173
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Asset </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_asset'>asset</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> is a video</span><span class='tstring_end'>"</span></span>
|
174
|
+
<span class='kw'>else</span>
|
175
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Asset </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_asset'>asset</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> is not a video</span><span class='tstring_end'>"</span></span>
|
176
|
+
<span class='kw'>end</span>
|
177
|
+
<span class='kw'>end</span>
|
178
|
+
</code></pre>
|
179
|
+
|
180
|
+
<h2 id="label-Development">Development</h2>
|
181
|
+
|
182
|
+
<p>After checking out the repo, run <code>bin/setup</code> to install
|
183
|
+
dependencies. You can also run <code>bin/console</code> for an interactive
|
184
|
+
prompt that will allow you to experiment.</p>
|
185
|
+
|
186
|
+
<p>To install this gem onto your local machine, run <code>bundle exec rake
|
187
|
+
install</code>. To release a new version, update the version number in
|
188
|
+
<code>version.rb</code>, and then run <code>bundle exec rake
|
189
|
+
release</code>, which will create a git tag for the version, push git
|
190
|
+
commits and tags, and push the <code>.gem</code> file to <a
|
191
|
+
href="https://rubygems.org">rubygems.org</a>.</p>
|
192
|
+
|
193
|
+
<h2 id="label-Contributing">Contributing</h2>
|
194
|
+
|
195
|
+
<p>Bug reports and pull requests are welcome on GitHub at <a
|
196
|
+
href="https://github.com/[USERNAME]/strawberry">github.com/[USERNAME]/strawberry</a>.
|
197
|
+
This project is intended to be a safe, welcoming space for collaboration,
|
198
|
+
and contributors are expected to adhere to the <a
|
199
|
+
href="http://contributor-covenant.org">Contributor Covenant</a> code of
|
200
|
+
conduct.</p>
|
201
|
+
|
202
|
+
<h2 id="label-License">License</h2>
|
203
|
+
|
204
|
+
<p>The gem is available as open source under the terms of the <a
|
205
|
+
href="https://opensource.org/licenses/MIT">MIT License</a>.</p>
|
206
|
+
|
207
|
+
<h2 id="label-Code+of+Conduct">Code of Conduct</h2>
|
208
|
+
|
209
|
+
<p>Everyone interacting in the Strawberry project’s codebases, issue trackers,
|
210
|
+
chat rooms and mailing lists is expected to follow the of
|
211
|
+
conduct[https://github.com/[USERNAME]/strawberry/blob/master/CODE_OF_CONDUCT.md].</p>
|
212
|
+
</div></div>
|
213
|
+
|
214
|
+
<div id="footer">
|
215
|
+
Generated on Thu Aug 30 12:51:39 2018 by
|
216
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
217
|
+
0.9.16 (ruby-2.5.0).
|
218
|
+
</div>
|
219
|
+
|
220
|
+
</div>
|
221
|
+
</body>
|
222
|
+
</html>
|
data/doc/file_list.html
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
16
|
+
|
17
|
+
|
18
|
+
<title>File List</title>
|
19
|
+
<base id="base_target" target="_parent" />
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<div id="content">
|
23
|
+
<div class="fixed_header">
|
24
|
+
<h1 id="full_list_header">File List</h1>
|
25
|
+
<div id="full_list_nav">
|
26
|
+
|
27
|
+
<span><a target="_self" href="class_list.html">
|
28
|
+
Classes
|
29
|
+
</a></span>
|
30
|
+
|
31
|
+
<span><a target="_self" href="method_list.html">
|
32
|
+
Methods
|
33
|
+
</a></span>
|
34
|
+
|
35
|
+
<span><a target="_self" href="file_list.html">
|
36
|
+
Files
|
37
|
+
</a></span>
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search">Search: <input type="text" /></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<ul id="full_list" class="file">
|
45
|
+
|
46
|
+
|
47
|
+
<li id="object_README" class="odd">
|
48
|
+
<div class="item"><span class="object_link"><a href="index.html" title="README">README</a></span></div>
|
49
|
+
</li>
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
</ul>
|
54
|
+
</div>
|
55
|
+
</body>
|
56
|
+
</html>
|
data/doc/frames.html
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Documentation by YARD 0.9.16</title>
|
6
|
+
</head>
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var match = unescape(window.location.hash).match(/^#!(.+)/);
|
9
|
+
var name = match ? match[1] : 'index.html';
|
10
|
+
name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
|
11
|
+
window.top.location = name;
|
12
|
+
</script>
|
13
|
+
<noscript>
|
14
|
+
<h1>Oops!</h1>
|
15
|
+
<h2>YARD requires JavaScript!</h2>
|
16
|
+
</noscript>
|
17
|
+
</html>
|
data/doc/index.html
ADDED
@@ -0,0 +1,222 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
File: README
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.16
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "README";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index</a> »
|
40
|
+
<span class="title">File: README</span>
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div id="search">
|
45
|
+
|
46
|
+
<a class="full_list_link" id="class_list_link"
|
47
|
+
href="class_list.html">
|
48
|
+
|
49
|
+
<svg width="24" height="24">
|
50
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
51
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
52
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
</svg>
|
54
|
+
</a>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
<div class="clear"></div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div id="content"><div id='filecontents'>
|
61
|
+
<h1 id="label-Strawberry">Strawberry</h1>
|
62
|
+
|
63
|
+
<p>A simple Ruby gem acting as a client for <a
|
64
|
+
href="http://www.flavoursys.com">Flavoursys Strawberry</a> REST API.</p>
|
65
|
+
|
66
|
+
<p>This unofficial implementation covers most of the features offered by
|
67
|
+
Strawberry API.</p>
|
68
|
+
|
69
|
+
<h2 id="label-Installation">Installation</h2>
|
70
|
+
|
71
|
+
<p>Add this line to your application's Gemfile:</p>
|
72
|
+
|
73
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>strawberry_api</span><span class='tstring_end'>'</span></span>
|
74
|
+
</code></pre>
|
75
|
+
|
76
|
+
<p>And then execute:</p>
|
77
|
+
|
78
|
+
<pre class="code ruby"><code class="ruby">$ bundle
|
79
|
+
</code></pre>
|
80
|
+
|
81
|
+
<p>Or install it yourself as:</p>
|
82
|
+
|
83
|
+
<pre class="code ruby"><code class="ruby">$ gem install strawberry_api
|
84
|
+
</code></pre>
|
85
|
+
|
86
|
+
<h2 id="label-Usage">Usage</h2>
|
87
|
+
|
88
|
+
<h3 id="label-Authentication">Authentication</h3>
|
89
|
+
|
90
|
+
<p>Authenticate to the server via regular credentials or by using an API key.
|
91
|
+
A standard error will be raised if authentication fails.</p>
|
92
|
+
|
93
|
+
<h4 id="label-API+key+based+authentication">API key based authentication</h4>
|
94
|
+
|
95
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>strawberry_api</span><span class='tstring_end'>'</span></span>
|
96
|
+
|
97
|
+
<span class='const'><span class='object_link'><a href="StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="StrawberryAPI.html#configure-class_method" title="StrawberryAPI.configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
|
98
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>server_IP_or_hostname</span><span class='tstring_end'>'</span></span>
|
99
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_api_key'>api_key</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>api_key</span><span class='tstring_end'>'</span></span>
|
100
|
+
<span class='kw'>end</span>
|
101
|
+
|
102
|
+
<span class='id identifier rubyid_strawberry'>strawberry</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="StrawberryAPI/Client.html" title="StrawberryAPI::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="StrawberryAPI/HttpClient.html#initialize-instance_method" title="StrawberryAPI::HttpClient#initialize (method)">new</a></span></span>
|
103
|
+
|
104
|
+
<span class='comment'># Returns currently logged in user info
|
105
|
+
</span><span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span>
|
106
|
+
<span class='comment'># => "#<Strawberry::API::User: id=2, username="api", ...
|
107
|
+
</span></code></pre>
|
108
|
+
|
109
|
+
<h4 id="label-User+credentials+based+authentication">User credentials based authentication</h4>
|
110
|
+
|
111
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>strawberry_api</span><span class='tstring_end'>'</span></span>
|
112
|
+
|
113
|
+
<span class='const'><span class='object_link'><a href="StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="StrawberryAPI.html#configure-class_method" title="StrawberryAPI.configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
|
114
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>server_IP_or_hostname</span><span class='tstring_end'>'</span></span>
|
115
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_username'>username</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>username</span><span class='tstring_end'>'</span></span>
|
116
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_password'>password</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>password</span><span class='tstring_end'>'</span></span>
|
117
|
+
<span class='kw'>end</span>
|
118
|
+
|
119
|
+
<span class='id identifier rubyid_strawberry'>strawberry</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="StrawberryAPI.html" title="StrawberryAPI (module)">StrawberryAPI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="StrawberryAPI/Client.html" title="StrawberryAPI::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="StrawberryAPI/HttpClient.html#initialize-instance_method" title="StrawberryAPI::HttpClient#initialize (method)">new</a></span></span>
|
120
|
+
|
121
|
+
<span class='comment'># Returns currently logged in user info
|
122
|
+
</span><span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span>
|
123
|
+
<span class='comment'># => "#<Strawberry::API::User: id=2, username="api", ...
|
124
|
+
</span></code></pre>
|
125
|
+
|
126
|
+
<h3 id="label-Making+requests">Making requests</h3>
|
127
|
+
|
128
|
+
<h4 id="label-Strawberry+API+client">Strawberry API client</h4>
|
129
|
+
|
130
|
+
<p><a href="doc/Strawberry/Client.html">API methods</a> are available as
|
131
|
+
client instance methods.</p>
|
132
|
+
|
133
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_strawberry'>strawberry</span> <span class='op'>=</span> <span class='const'>Strawberry</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
134
|
+
|
135
|
+
<span class='comment'># Returns all Strawberry projects
|
136
|
+
</span><span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_projects'>projects</span>
|
137
|
+
<span class='comment'># => [#<Strawberry::API::Project: id=6, name="test_project", ...
|
138
|
+
</span></code></pre>
|
139
|
+
|
140
|
+
<h3 id="label-Samples">Samples</h3>
|
141
|
+
|
142
|
+
<p>Most API methods return an object which provide dot notation access for
|
143
|
+
fields returned in the API response.</p>
|
144
|
+
|
145
|
+
<p>See the <a href="samples">samples</a> directory for more examples.</p>
|
146
|
+
|
147
|
+
<h4 id="label-Methods+returning+an+object">Methods returning an object</h4>
|
148
|
+
|
149
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_project'>project</span><span class='lparen'>(</span><span class='label'>id:</span> <span class='int'>6</span><span class='rparen'>)</span>
|
150
|
+
<span class='comment'># => #<Strawberry::API::Project: id=6, name="test_project", ...
|
151
|
+
</span></code></pre>
|
152
|
+
|
153
|
+
<h4 id="label-Methods+returning+an+array+of+project+objects">Methods returning an array of project objects</h4>
|
154
|
+
|
155
|
+
<p>Some methods return an array of objects .</p>
|
156
|
+
|
157
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_projects'>projects</span>
|
158
|
+
<span class='comment'># => [#<Strawberry::API::Project: id=6, name="test_project", ...
|
159
|
+
</span></code></pre>
|
160
|
+
|
161
|
+
<h4 id="label-Methods+returning+a+Boolean">Methods returning a Boolean</h4>
|
162
|
+
|
163
|
+
<p>A few other methods return a Boolean. The following example uses the
|
164
|
+
<code>video?</code> method which indicates whether the asset is a video or
|
165
|
+
not.</p>
|
166
|
+
|
167
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_assets'>assets</span> <span class='op'>=</span> <span class='id identifier rubyid_strawberry'>strawberry</span><span class='period'>.</span><span class='id identifier rubyid_assets'>assets</span>
|
168
|
+
<span class='comment'># => [#<Strawberry::API::Asset: id=6, name="test_asset", ...
|
169
|
+
</span>
|
170
|
+
<span class='id identifier rubyid_assets'>assets</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_asset'>asset</span><span class='op'>|</span>
|
171
|
+
<span class='comment'># Returns true of false
|
172
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_asset'>asset</span><span class='period'>.</span><span class='id identifier rubyid_video?'>video?</span>
|
173
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Asset </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_asset'>asset</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> is a video</span><span class='tstring_end'>"</span></span>
|
174
|
+
<span class='kw'>else</span>
|
175
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Asset </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_asset'>asset</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> is not a video</span><span class='tstring_end'>"</span></span>
|
176
|
+
<span class='kw'>end</span>
|
177
|
+
<span class='kw'>end</span>
|
178
|
+
</code></pre>
|
179
|
+
|
180
|
+
<h2 id="label-Development">Development</h2>
|
181
|
+
|
182
|
+
<p>After checking out the repo, run <code>bin/setup</code> to install
|
183
|
+
dependencies. You can also run <code>bin/console</code> for an interactive
|
184
|
+
prompt that will allow you to experiment.</p>
|
185
|
+
|
186
|
+
<p>To install this gem onto your local machine, run <code>bundle exec rake
|
187
|
+
install</code>. To release a new version, update the version number in
|
188
|
+
<code>version.rb</code>, and then run <code>bundle exec rake
|
189
|
+
release</code>, which will create a git tag for the version, push git
|
190
|
+
commits and tags, and push the <code>.gem</code> file to <a
|
191
|
+
href="https://rubygems.org">rubygems.org</a>.</p>
|
192
|
+
|
193
|
+
<h2 id="label-Contributing">Contributing</h2>
|
194
|
+
|
195
|
+
<p>Bug reports and pull requests are welcome on GitHub at <a
|
196
|
+
href="https://github.com/[USERNAME]/strawberry">github.com/[USERNAME]/strawberry</a>.
|
197
|
+
This project is intended to be a safe, welcoming space for collaboration,
|
198
|
+
and contributors are expected to adhere to the <a
|
199
|
+
href="http://contributor-covenant.org">Contributor Covenant</a> code of
|
200
|
+
conduct.</p>
|
201
|
+
|
202
|
+
<h2 id="label-License">License</h2>
|
203
|
+
|
204
|
+
<p>The gem is available as open source under the terms of the <a
|
205
|
+
href="https://opensource.org/licenses/MIT">MIT License</a>.</p>
|
206
|
+
|
207
|
+
<h2 id="label-Code+of+Conduct">Code of Conduct</h2>
|
208
|
+
|
209
|
+
<p>Everyone interacting in the Strawberry project’s codebases, issue trackers,
|
210
|
+
chat rooms and mailing lists is expected to follow the of
|
211
|
+
conduct[https://github.com/[USERNAME]/strawberry/blob/master/CODE_OF_CONDUCT.md].</p>
|
212
|
+
</div></div>
|
213
|
+
|
214
|
+
<div id="footer">
|
215
|
+
Generated on Thu Aug 30 12:51:39 2018 by
|
216
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
217
|
+
0.9.16 (ruby-2.5.0).
|
218
|
+
</div>
|
219
|
+
|
220
|
+
</div>
|
221
|
+
</body>
|
222
|
+
</html>
|