Skip to content

Commit

Permalink
beginnings of an install rake task, some ui stuff as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Bornsztein committed May 22, 2008
1 parent fbd929e commit 291407f
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 9 deletions.
1 change: 1 addition & 0 deletions README
Expand Up @@ -13,6 +13,7 @@ Requirements:
htmlentities htmlentities
redcloth redcloth
rake 0.8.1 rake 0.8.1
mysql


GETTING COMMUNITY ENGINE RUNNING GETTING COMMUNITY ENGINE RUNNING
================================================================== ==================================================================
Expand Down
1 change: 1 addition & 0 deletions app/controllers/posts_controller.rb
Expand Up @@ -88,6 +88,7 @@ def preview
def new def new
@user = User.find(params[:user_id]) @user = User.find(params[:user_id])
@post = Post.new(params[:post]) @post = Post.new(params[:post])
@post.published_as = 'live'
end end


# GET /posts/1;edit # GET /posts/1;edit
Expand Down
2 changes: 1 addition & 1 deletion app/views/activities/_icon.haml
Expand Up @@ -5,7 +5,7 @@
- when 'Favorite' - when 'Favorite'
= image_tag 'icons/heart.png', :plugin => 'community_engine' = image_tag 'icons/heart.png', :plugin => 'community_engine'
- when 'Photo' - when 'Photo'
= image_tag 'icons/photo.png', :plugin => 'community_engine' = image_tag 'icons/picture.png', :plugin => 'community_engine'
- when 'Comment' - when 'Comment'
= image_tag 'icons/comment.png', :plugin => 'community_engine' = image_tag 'icons/comment.png', :plugin => 'community_engine'
- when 'Clipping' - when 'Clipping'
Expand Down
7 changes: 3 additions & 4 deletions app/views/polls/_excerpt.haml
@@ -1,5 +1,4 @@
.poll_excerpt .poll_excerpt
%h4.question =image_tag 'icons/poll.png', :plugin => 'community_engine'
= poll.question = poll.question
= link_to "Vote Now!", new_vote_path(:post_id => poll.post.id), {:title => 'Log in to vote', :class => 'vote'} = link_to "Vote Now!", new_vote_path(:post_id => poll.post.id), {:title => 'Log in to vote', :class => 'vote'}

2 changes: 1 addition & 1 deletion app/views/users/dashboard.html.haml
Expand Up @@ -43,7 +43,7 @@
%h3= random_greeting(@user) %h3= random_greeting(@user)


-if @user.pending_friendships.any? -if @user.pending_friendships.any?
%p=link_to "#{image_tag 'icons/friend.png', :plugin => 'community_engine'} You have pending friendship requests.", pending_user_friendships_path(@user) %p=link_to "#{image_tag 'icons/user_add.png', :plugin => 'community_engine'} You have pending friendship requests.", pending_user_friendships_path(@user)




-if @network_activity.empty? && @recommended_posts.empty? -if @network_activity.empty? && @recommended_posts.empty?
Expand Down
Binary file modified assets/images/icons/activity_default.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/icons/friend.png
Binary file not shown.
Binary file removed assets/images/icons/photo.png
Binary file not shown.
Binary file modified assets/images/icons/poll.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions tasks/community_engine_tasks.rake
Expand Up @@ -15,6 +15,7 @@ namespace :db do
end end


namespace :community_engine do namespace :community_engine do

desc 'Move the community engine assets to application public directory' desc 'Move the community engine assets to application public directory'
task :mirror_public_assets => :environment do task :mirror_public_assets => :environment do
# actually, no need to do anything here, the mere act of running rake mirrors the plugin assets for everything # actually, no need to do anything here, the mere act of running rake mirrors the plugin assets for everything
Expand Down Expand Up @@ -71,10 +72,7 @@ namespace :community_engine do
task :clobber_rcov do |t| task :clobber_rcov do |t|
rm_r OUTPUT_DIR, :force => true rm_r OUTPUT_DIR, :force => true
end end

end end




namespace :db do namespace :db do
namespace :fixtures do namespace :fixtures do
Expand Down
29 changes: 29 additions & 0 deletions tasks/install.rake
@@ -0,0 +1,29 @@
namespace :community_engine do

desc 'Install Community Engine for the first time'
task :install => [:check_required_gems] do

Rake::Task["community_engine:generate_plugin_migrations"].invoke
#check for engines plugin
end

desc 'Check if the required gems are present'
task :check_required_gems do
#check if we have the required gems
installed_gems = `gem list --no-details --no-versions`.split("\n")
required_gems = %w(rmagick hpricot mime-types htmlentities RedCloth rake mysql)
missing_gems = required_gems-installed_gems

if missing_gems.any?
raise "CommunityEngine installation can't continue because you are missing these required gems: \n - #{missing_gems.join("\n- ")}"
end
end

desc 'Generate CommunityEngine plugin migrations'
task :generate_plugin_migrations do
`./script/generate plugin_migration community_engine`
end

end


0 comments on commit 291407f

Please sign in to comment.