Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Minor fixes and a nil-related bug squashing #5

Closed
wants to merge 5 commits into from

2 participants

@kfox
Collaborator

I tidied up the Readme (though it probably needs another going-over or two or three), fixed a couple minor annoyances (e.g., removed Gemfile.lock from the repo, fixed a typo), and fixed a bug that prevented user profile updates, at least locally.

@sudara sudara closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  .gitignore
@@ -43,3 +43,4 @@ public/system
public/sitemap.xml
tmp
.bundle
+Gemfile.lock
View
65 Gemfile.lock
@@ -1,65 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- BlueCloth (1.0.1)
- actionmailer (2.3.4)
- actionpack (= 2.3.4)
- actionpack (2.3.4)
- activesupport (= 2.3.4)
- rack (~> 1.0.0)
- activerecord (2.3.4)
- activesupport (= 2.3.4)
- activeresource (2.3.4)
- activesupport (= 2.3.4)
- activesupport (2.3.4)
- aws-s3 (0.5.1)
- builder
- mime-types
- xml-simple
- builder (2.1.2)
- googlecharts (1.6.0)
- haml (2.0.9)
- hpricot (0.8.2)
- mime-types (1.16)
- mysql (2.8.1)
- newrelic_rpm (2.12.3)
- nokogiri (1.4.3.1)
- rack (1.0.1)
- rails (2.3.4)
- actionmailer (= 2.3.4)
- actionpack (= 2.3.4)
- activerecord (= 2.3.4)
- activeresource (= 2.3.4)
- activesupport (= 2.3.4)
- rake (>= 0.8.3)
- rake (0.8.7)
- rmagick (2.13.1)
- rspec (1.3.0)
- rspec-rails (1.3.2)
- rack (>= 1.0.0)
- rspec (>= 1.3.0)
- ruby-mp3info (0.6.13)
- rubyzip (0.9.4)
- will_paginate (2.3.14)
- xml-simple (1.0.12)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- BlueCloth
- aws-s3 (~> 0.5.0)
- googlecharts
- haml (= 2.0.9)
- hpricot
- mime-types
- mysql
- newrelic_rpm
- nokogiri
- rails (= 2.3.4)
- rmagick
- rspec (>= 1.2.0)
- rspec-rails (>= 1.2.0)
- ruby-mp3info
- rubyzip
- will_paginate
View
60 README.markdown
@@ -14,7 +14,7 @@ Or get jiggy with our build-to-order API and do something crazy and exciting.
### Bug reporting
-We use [lighthouse](http://alonetone.lighthouseapp.com) to submit bugs and keep track of our work
+We use [lighthouse](http://alonetone.lighthouseapp.com) to submit bugs and keep track of our work.
### The goal?
@@ -25,13 +25,12 @@ How do we reach this goal?
* It must be easy to use, straightforward, intuitive, and consistent (grandma-friendly)
* It must be attractive to look at
* It provides musicians with practical, useful and inspiring tools and services
-* It provides listeners and first time site visitors with a 'hook' into their first taste of alonetone music and helps them explore the site in an intelligent and guided way.
-* It encourages artist exploration and the feeling to stick around.
+* It provides listeners and first time site visitors with a 'hook' into their first taste of alonetone music and helps them explore the site in an intelligent and guided way
+* It encourages artist exploration and the feeling to stick around
* It does not overwhelm folks with TMI (too much information) or TMO (too many options) or TMF (too many features)
For more info, visit [the alonetone faq](http://alonetone.com/about)
-
### Current feature set
Really, only the very basics are implemented.
@@ -54,7 +53,7 @@ Really, only the very basics are implemented.
### Want to join forces?
-First of all, talk to Sudara by emailing Sudara at alonetone com
+First of all, talk to Sudara by emailing Sudara at alonetone com.
Secondly, [sign up for an account](http://alonetone.com) and start digging in.
@@ -70,15 +69,17 @@ If you do want to get jiggy and setup alonetone locally, the best thing to do is
alonetone uses 6 config files:
- alonetone.yml (contains the application "secret" and app-specific settings)
- database.yml
- amazon_s3.yml (used in production, by default development mode runs with :file_system storage)
- defensio.yml (spam protection, ignored in development)
- facebooker.yml (for facebook app, ignore this in general for now)
- newrelic.yml (for performance tracking)
+ alonetone.yml (contains the application "secret" and app-specific settings)
+ database.yml
+ amazon_s3.yml (used in production, by default development mode runs with :file_system storage)
+ defensio.yml (spam protection, ignored in development)
+ facebooker.yml (for facebook app, ignore this in general for now)
+ newrelic.yml (for performance tracking)
These files will be created for you the first time you run any rake task.
+#### Gem installation
+
You'll need some gems, at least:
rmagick
@@ -89,34 +90,47 @@ You'll need some gems, at least:
aws-s3 (if you use Amazon S3 to store files)
rubyzip (for extracting mp3s from zip files)
mocha (for rspec)
+
+You can install all of the gem dependencies using one of three ways:
+
+1. **Bundler**
+
+ If you have the Bundler gem installed, you can install all of the dependencies like so:
+
+ ` bundle update`
+
+2. **Rake**
-You can let the system install all required gems for you using following command:
+ Otherwise, you can install all the required gems using the following command:
+
+ ` rake gems:install`
+
+ NOTE: On a Windows install using InstantRails with Rails 2.2.2 and RubyGems 1.3, an error such as 'uninitialized constant ApplicationController::ALONETONE' might present itself when using the 'rake gems:install' command. However, I found that if you install all of the gems manually that you can ignore this error message.
- rake gems:install
+3. **Manual installation**
-NOTE: On a Windows install using InstantRails with Rails 2.2.2 and RubyGems 1.3, an error such as 'uninitialized constant ApplicationController::ALONETONE' might present itself when using the 'rake gems:install' command. However, I found that if you install all of the gems manually that you can ignore this error message.
+ If you have troubles with the above, you can also install them manually:
-You can also install them manually:
+ ` sudo gem install rmagick haml json ruby-mp3info aws-s3 rubyzip mocha`
- sudo gem install rmagick haml json ruby-mp3info aws-s3 rubyzip mocha
+ You may need to install imagemagick before rmagick. If you are using Ubuntu you can run 'sudo apt-get install imagemagick libmagick9-dev'. If you are on a Mac, you can 'sudo port install imagemagick'.
-You may need to install imagemagick before rmagick. If you are using Ubuntu you can run 'sudo apt-get install imagemagick libmagick9-dev'. If you are on a Mac, you can 'sudo port install imagemagick'
-
-You'll need to install rails 2.1 gem or have a copy in the vendor directory.
+#### Database setup
Then, you can create a development database, run all migrations and load some bootstrap data with:
rake db:remake
+#### Logging in
-After bootstrap data is loaded, you can login using test account with username=test, password=test.
+After the bootstrap data is loaded, you can login using the test account (username=test, password=test).
-You will see session and current\_user information at the end of each page after login. You can turn it off by changing show\_debug_info to false in alonetone.yml
+You will see session and current\_user information at the end of each page after login. You can turn it off by changing show\_debug_info to false in alonetone.yml.
-After login, click on "Upload" button to upload your first mp3.
+After login, click on the "Upload" button to upload your first mp3.
### License
The alonetone source code is released under the MIT license.
-"alonetone", "alonetone.com" and the alonetone logo are copyright Sudara Williams 2008 and may not be used without permission.
+"alonetone", "alonetone.com" and the alonetone logo are copyright Sudara Williams 2008 and may not be used without permission.
View
6 app/controllers/users_controller.rb
@@ -164,8 +164,10 @@ def update
# If the user changes the :block_guest_comments setting then it requires
# that the cache for all their tracks be invalidated or else the cached
# tabs will not change
- currently_blocking_guest_comments = @user.settings.present?('block_guest_comments') && @user.settings['block_guest_comments'] == 'true'
- flush_asset_caches = params[:user][:settings][:block_guest_comments] == ( currently_blocking_guest_comments ? "false" : "true" )
+ if (@user.present?(:settings) && @user.settings.present?('block_guest_comments'))
+ currently_blocking_guest_comments = @user.settings['block_guest_comments'] == 'true'
+ flush_asset_caches = params[:user][:settings][:block_guest_comments] == ( currently_blocking_guest_comments ? "false" : "true" )
+ end
@user.attributes = params[:user]
# temp fix to let people with dumb usernames change them
View
2  app/views/users/edit.html.erb
@@ -76,7 +76,7 @@
<h2 class="box">Settings</h2>
<div class="static_content">
<% form_for @user, :html => { :method => :put } do |f| -%>
- Display play counts blatently on all tracks? <br/>
+ Display play counts blatantly on all tracks? <br/>
<%= select_tag('user[settings][display_listen_count]',
options_for_select([['no thanks','false'], ['yes','true']],
setting(:display_listen_count))) %>
Something went wrong with that request. Please try again.