Permalink
Browse files

Minor doc touchups around site

  • Loading branch information...
1 parent d212bc9 commit 15cc819a5e835c18631b6eaf71aaa3961c8c8068 @katzgrau committed May 7, 2011
@@ -33,7 +33,7 @@ public function add()
}
else
{
- UserHelper::setNotice("Try to enter a valid version string when creating a new version", FALSE);
+ UserHelper::setNotice("Try to enter a valid tag!", FALSE);
}
$spark = Spark::getById($insert['spark_id']);
View
13 application/models/spark.php 100644 → 100755
@@ -337,14 +337,14 @@ public function setVersionStatus($version, $deactivated = FALSE)
* @param array $errors The things wrong with the spark
* @return bool
*/
- public function removeVersionAndNotify($version, $errors)
+ public function removeTagAndNotify($tag, $errors)
{
$this->load->helper('email');
$contrib = $this->getContributor();
$sys_email = config_item('system_alert_email');
$message = "Hey there,
-This is an automated message to tell you that version '$version' of
+This is an automated message to tell you that tag '$tag' of
$this->name couldn't be verified ($this->base_location).
We've removed that version from our system at getsparks. Once you get
things figured out on your end, you can re-add the version :).
@@ -353,12 +353,11 @@ public function removeVersionAndNotify($version, $errors)
foreach($errors as $error)
$message .= "$error\n";
- send_email("{$contrib->email},{$sys_email}", "{$this->name} v{$version} Removed.", $message);
+ send_email("{$contrib->email},{$sys_email}", "{$this->name} {$tag} Removed.", $message);
$this->db->where('spark_id', $this->id);
- $this->db->where('version', $version);
-
- return $this->db->delete('versions');
+ $this->db->where('tag', $tag);
+ return $this->db->delete('versions');
}
/**
@@ -485,4 +484,4 @@ public function processDependencies($spec)
return TRUE;
}
-}
+}
@@ -8,7 +8,7 @@
<title>CodeIgniter Sparks | <?php echo isset($title) ? "$title" : "The Package Manager and Repository"; ?></title>
-<?php display_css(array('reset.css', 'fancybox.css', 'style.css', 'clear.css')); ?>
+<?php display_css(array('reset.css', 'style.css', 'clear.css')); ?>
<?php display_js(array('jquery-1.4.4.min.js',
'jquery-ui-1.8.9.min.js',
@@ -34,14 +34,14 @@
[ SPARK ] Retrieving spark detail from getsparks.org
[ SPARK ] From Downtown! Retrieving spark from Mercurial repository at https://github.com/katzgrau/example-spark
[ SPARK ] Installing spark
-[ SPARK ] Spark installed to ./sparks/example-spark/1.0 - You're on fire!
+[ SPARK ] Spark installed to ./sparks/example-spark/1.0.0 - You're on fire!
</pre>
Now your spark is installed! In your application, try:
<pre>
-$this->load->spark('example-spark/1.0'); # We specify the version for now. This might change
-$this->example_spark->printHello(); # echo's "Hello from the example spark!"
+$this->load->spark('example-spark/1.0.0'); # We always specify the version for now. This might change
+$this->example_spark->printHello(); # echo's "Hello from the example spark!"
</pre>
<p>Now you can install all the sparks you want. And if you feel like contributing your own, check out <a href="<?php echo base_url(); ?>make-sparks">Making Sparks</a>.</p>
@@ -66,7 +66,7 @@
version, which is the latest (sometimes denoted as 'HEAD').
</li>
<li>
- Click the link to "Get example-spark-v1.0.zip", and download it.
+ Click the link to "Get example-spark-1.0.0.zip", and download it.
</li>
<li>
Extract the contents of the zip to a folder inside the sparks/ directory at the base of
@@ -91,7 +91,7 @@
<p>Now your spark is installed! Try this from within your application:</p>
<pre>
-$this->load->spark('example-spark'); # Don't forget to add '/[version]' if you added a version folder!
+$this->load->spark('example-spark/1.0.0'); # Don't forget to add '/[version]' if you added a version folder!
$this->example_spark->printHello(); # echo's "Hello from the example spark!"
</pre>
</ol>
@@ -44,7 +44,7 @@
<p>
After that, you register new versions of your spark on GetSparks by pointing
us towards a tag in your repository. That is, if you
- create tag '1.0' in your repo, just add a '1.0' version to your project in
+ create tag '1.0.0' in your repo, just add a '1.0.0' version to your project in
GetSparks. In a few minutes, it'll be available to the world.
</p>
@@ -104,17 +104,20 @@
</p>
<ol>
- <li>Create a directory inside your sparks folder named 'birdseed'.</li>
<li>
- Inside birdseed, create a 'config' folder, and also, create a
- 'helpers' folder.
+ Create a directory inside your sparks folder named 'birdseed'. Inside that,
+ create a directory named '0.0.1', which is the version of this spark.
+ This exact structure (sparkname/version) is created automatically when people install your spark.
</li>
<li>
- Create a file named 'birdseed.php' and 'autoload.php' inside birdseed/config. Note that
+ Inside '0.0.1', create a 'config' folder and a 'helpers' folder.
+ </li>
+ <li>
+ Create files named 'birdseed.php' and 'autoload.php' inside 0.0.1/config. Note that
you should generally name your config files the same as your spark.
</li>
<li>
- Inside birdseed/config/birdseed.php, place this, and save the file:
+ Inside 0.0.1/config/birdseed.php, place this, and save the file:
<pre>
&lt;?php
@@ -123,7 +126,7 @@
</pre>
</li>
<li>
- Inside birdseed/config/autoload.php, place this, and save the file:
+ Inside 0.0.1/config/autoload.php, place this, and save the file:
<pre>
&lt;?php
@@ -141,7 +144,7 @@
</p>
</li>
<li>
- Create the file 'helpers/birdseed_helper.php'. Inside it, place this, and
+ Create the file '0.0.1/helpers/birdseed_helper.php'. Inside it, place this, and
save:
<pre>
&lt;?php
@@ -175,7 +178,7 @@ function birdseed_fetch($username, $n = 10)
</pre>
</li>
<li>
- Inside birdseed/spark.info, place this, and save the file:
+ Inside 0.0.1/spark.info, place this, and save the file:
<pre>
# This is the spark-sdk specification. It's in a magical format called YAML.
# Use this format while developing your own sparks!
@@ -198,15 +201,17 @@ function birdseed_fetch($username, $n = 10)
# some-other-spark-2: 1.0.0
</pre>
<p>
- This is important for when you want to contribute your spark. Read
- more about <a href="<?php echo base_url(); ?>spec-format">spec formats here</a>.
+ This is your 'spark.info' file, which is required with every new spark. It
+ tells the spark processor about your spark, and most importantly, supplies
+ version information. <strong>Versions must always be in x.x.x format!</strong> Read more about
+ <a href="<?php echo base_url(); ?>spec-format">spec formats here</a>.
</p>
</li>
<li>
Now you're ready to try your new spark. From somewhere inside your
CodeIgniter Application, try:
<pre>
-$this->load->spark('birdseed');
+$this->load->spark('birdseed/0.0.1');
# Grab _kennyk_'s tweets
$tweets = birdseed_fetch('_kennyk_', 5);
@@ -217,7 +222,7 @@ function birdseed_fetch($username, $n = 10)
&lt;?php
# Load the spark and get some tweets
- $this->load->spark('birdseed');
+ $this->load->spark('birdseed/0.0.1');
$tweets = birdseed_fetch('_kennyk_', 5);
?&gt;
@@ -243,16 +248,20 @@ function birdseed_fetch($username, $n = 10)
<ol>
<li>
- You have an account at GitHub or BitBucket, or you run your own
- publicly-accessible git or mercurial server. If you don't have one of
- these, go get one and join the open-source world!
+ <p>
+ You have an account at GitHub or BitBucket, or you run your own
+ publicly-accessible git or mercurial server. If you don't have one of
+ these, go get one and join the open-source world!
+ </p>
</li>
<li>
You know how to set up a project in your repository.
</li>
<li>
- You know what a "Clone URL" is, and how to get a publicly-readable
- clone URL from your repository.
+ <p>
+ You know what a "Clone URL" is, and how to get a publicly-readable
+ clone URL from your repository.
+ </p>
</li>
</ol>
@@ -261,21 +270,26 @@ function birdseed_fetch($username, $n = 10)
<ol>
<li>
<p>
- If you haven't already, copy your spark's files into your project
+ If you haven't already, copy your spark's files (everything <em>inside</em> birdseed/0.0.1) into your project
directory.
</p>
</li>
<li>
- It is not required, but good practice to validate your spark <em>before</em>
- submitting it to the repository. You can do this by installing the
- 'spark-sdk' spark, <a href="http://getsparks.org/packages/spark-sdk/versions/HEAD/show">available here</a>.
+ <p>
+ <strong><a href="http://getsparks.org/packages/spark-sdk/versions/HEAD/show">Spark SDK</a></strong>: It is not required, <strong>but good practice</strong> to validate your spark <em>before</em>
+ submitting it to the repository. You can do this by installing the
+ 'spark-sdk' spark, <a href="http://getsparks.org/packages/spark-sdk/versions/HEAD/show">available here</a>.
+ This is <em>almost</em> the exact validator that GetSparks.org uses.
+ </p>
</li>
<li>
- Optionally, you may add a readme file at the root of your
- spark. Readme files are expected to be in
- <a target="_blank" href="http://daringfireball.net/projects/markdown/syntax">
- markdown format</a>. This readme
- will be parsed and posted with your spark when it goes live.
+ <p>
+ Optionally, you may add a readme file at the root of your
+ spark. Readme files are expected to be in
+ <a target="_blank" href="http://daringfireball.net/projects/markdown/syntax">
+ markdown format</a>. This readme
+ will be parsed and posted with your spark when it goes live.
+ </p>
</li>
<li>
Push the files to your repository via:
@@ -294,13 +308,13 @@ function birdseed_fetch($username, $n = 10)
<li>
Create and push a new tag. This should be something sane, like a version number.
<pre>
-$ hg tag '1.0'
+$ hg tag '0.0.1'
$ hg commit -m "My neato releaso ;)"
$ hg push
</pre>
Or
<pre>
-$ git tag '1.0'
+$ git tag '0.0.1'
$ git push --tags
</pre>
</li>
@@ -322,7 +336,7 @@ function birdseed_fetch($username, $n = 10)
<p>
You should now be on your project's page. You'll notice a form that
says "Add a New Version." This is where you enter the tag that you
- created in step 3. Enter "1.0" and click "Create from Tag"
+ created in step 3. Enter "0.0.1" and click "Create from Tag"
</p>
<p>
Your spark entry will be created, but marked as "unverified".
@@ -343,7 +357,7 @@ function birdseed_fetch($username, $n = 10)
<p>
Once your spark has been verified, version information and a download-able
zip will appear on the page. If you have the spark-manager installed
- in one of your applications, you can open up a terminal and navigate to your project.
+ in one of your applications, you can open up a terminal and navigate to a new project.
Try:
<code>
$ php tools\spark install [your-spark-name]
@@ -37,6 +37,7 @@
# These are other sparks which this spark needs in order to work correctly.
# Dependencies should be in NAME: VERSION format, where NAME is an existing
# spark name, and VERSION is a version in x.x.x format.
+# This is optional, so comment it out if it's unneeded
dependencies:
spark-1: 1.0.0
spark-2: 1.0.0
@@ -26,12 +26,12 @@
</tr>
<tr>
<td>Author Website</td>
- <td>: <a target="_blank" href="<?php echo $contributor->website; ?>"><?php echo $contributor->website; ?></a></td>
+ <td>: <a target="_blank" href="<?php echo prep_url($contributor->website); ?>"><?php echo $contributor->website; ?></a></td>
</tr>
<?php if($contribution->website): ?>
<tr>
<td>Spark Website</td>
- <td>: <a target="_blank" href="<?php echo $contribution->website; ?>"><?php echo $contribution->website; ?></a></td>
+ <td>: <a target="_blank" href="<?php echo prep_url($contribution->website); ?>"><?php echo $contribution->website; ?></a></td>
</tr>
<?php endif; ?>
<tr>
@@ -101,17 +101,18 @@
<?php if(UserHelper::getId() == $contribution->contributor_id): ?>
<div class="form-wrapper clearfix">
<form action="<?php echo base_url(); ?>versions/add" method="post">
+
+ <h5>Author: Add a new version (via repository tag): <br /></h5>
<p>
- Add a new version: <br />
- <small>
- Note that after you add this, the spark will be processed on our end. <br/>
- The version string you enter below should correspond to a tag in your
- source repository. <br/>
+ <small>
+ After you add this, the spark will be processed on our end. <br/>
+ The string you enter below should correspond to a tag in your
+ source repository. If the tag isn't valid, we'll pull the latest.<br/>
</small>
</p>
<input type="text" name="tag" />
<input type="hidden" name="spark_id" value="<?php echo $contribution->id; ?>" />
- <input type="submit" name="submit" value="Create From Tag" />
+ <input class="fun-button" type="submit" name="submit" value="Create From Tag" />
</form>
</div>
<p></p>
View
16 scripts/gather-zips.php 100644 → 100755
@@ -62,7 +62,7 @@
try
{
# All or nothing. Verify versions aand insert dependencies atomically
- $CI->db->trans_start();
+ $CI->db->trans_begin();
# Load the spark's YAML Spec
$spec = Spark_spec::loadFromDirectory($tmp);
# Add any dependencies in the spec
@@ -81,15 +81,19 @@
# Mark this spark as verified
$spark->setVerified($spec->version, TRUE, base_url().config_item('archive_path').$spark->name.'/'.$release.".zip");
# Commit anything we've done
- $CI->db->trans_complete();
+ if($CI->db->trans_status() !== FALSE)
+ $CI->db->trans_commit();
+ else
+ throw new Exception("There was an unknown error processing the spark :(");
# Yay, keep track of it
$successful[] = $spark;
}
catch(Exception $ex)
{
- echo "Error processing {$spark->name} - {$spec->version}: " . $ex->getMessage() . ". Removing..\n";
+ $CI->db->trans_rollback();
+ echo "Error processing {$spark->name} - {$spark->tag}: " . $ex->getMessage() . ". Removing..\n";
$errors = array($ex->getMessage());
- $spark->removeVersionAndNotify($spec->version, $errors);
+ $spark->removeTagAndNotify($spark->tag, $errors);
$unsuccessful[] = $spark;
`rm -rf $tmp`;
continue;
@@ -108,5 +112,5 @@
echo "\n" . count($unsuccessful) . " errors.\n";
foreach($unsuccessful as $spark)
{
- echo "$spark->id - $spark->name - $spec->version\n";
-}
+ echo "$spark->id - $spark->name - $spark->tag\n";
+}
@@ -83,15 +83,15 @@ public static function loadFromDirectory($filepath)
/* Check that the spark file exists */
if(!file_exists($specfile))
{
- throw new SpecValidationException("The spec file does not exist in the spark's root: $filename");
+ throw new SpecValidationException("The '$filename' does not exist in the spark's root: See http://getsparks.org/spec-format");
}
/* Load it, it should have a $spec setup inside it */
$spec = Yaml::parse_file($specfile);
if(!is_array($spec))
{
- throw new SpecValidationException("The spec does not contain valid spec information: $filename");
+ throw new SpecValidationException("The '$filename' does not contain valid spec information: See http://getsparks.org/spec-format");
}
/* Create a spec instance */
View
@@ -55,6 +55,8 @@ body { background-color: #4D0202; /* background: #f0f0f0 url('/static/images/ci-
#header form#headersearch input.submit { margin-top: 5px; }
#page div.page-left div.login-box a.register { padding: 5px 10px 7px 10px; float: right; margin-right: 5px; }
+.fun-button { -moz-border-radius:5px 5px 5px 5px; -moz-box-shadow:1px 1px 2px #000000; background-color:#D14000; border:1px solid #F0F0F0; color:#FFFFFF; display:inline-block; font-size:11px; font-weight:normal; margin-left:10px; padding:2px 2px; text-decoration:none; }
+
#page div.page-left div.login-box div.profile-image { float: left; margin-right: 10px; }
#page div.page-left div.login-box div.profile-links { float: left; width: 130px; }
#page div.page-left div.login-box div.profile-links a { color: #fff; font-size: 12px; }

0 comments on commit 15cc819

Please sign in to comment.