-<% end %>
-
-<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/layouts/api.html.haml b/app/views/layouts/api.html.haml
deleted file mode 100644
index e7067271..00000000
--- a/app/views/layouts/api.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-!!! 5
-%html
- %head
- %title Hackety Hack API: #{title}
- %body
- %h1 Hackety Hack API: #{title}
- = yield
- %footer
- You can go #{link_to "back to the API root", root_path}
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
deleted file mode 100644
index bad870f4..00000000
--- a/app/views/layouts/application.html.haml
+++ /dev/null
@@ -1,74 +0,0 @@
-- @page_class ||= "page"
-!!!
-%html
- %head
- - title = yield :title
- %title=(title.blank? ? "" : title.gsub("\n", "")) + " | Hackety Hack!"
-
-
- /
-
- = stylesheet_link_tag "application"
- = javascript_include_tag "application"
- = csrf_meta_tags
- - if Rails.env.production?
- :javascript
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-10499799-1']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
- })();
-
-
-
-
-
- = yield(:head)
-
- %body{:class => "body-#{@page_class}"}
- %header.topbar
- .topbar-inner
- .container
- #logo
- = link_to "Hackety Hack", root_path
- = render "shared/menu/main"
- = render "shared/menu/user"
-
- = yield :top
-
- - sidebar = yield :sidebar
-
- #content-wrap{:class => @page_class}
- .container{:class => sidebar.empty? ? "one-column" : "two-column"}
- - if flash[:notice]
- .alert-message.success
- #{flash[:notice]}
- - if flash[:alert]
- .alert-message.alert
- #{flash[:alert]}
-
- = yield :alert
-
- - unless title.empty?
- .page-title
- %h1.title
- = title
- %small= yield :subtitle
- .feed
- = yield :feed
-
- #content{:class => @content_class}
- = yield
-
- - unless sidebar.empty?
- #sidebar
- = sidebar
-
- %footer
- .container
- = render "shared/menu/footer"
-
diff --git a/app/views/lessons/index.html.haml b/app/views/lessons/index.html.haml
deleted file mode 100644
index bb1efa39..00000000
--- a/app/views/lessons/index.html.haml
+++ /dev/null
@@ -1,20 +0,0 @@
-- content_for :title do
- Lessons
-
-- content_for :sidebar do
- = render :partial => "shared/ask"
- = render :partial => "shared/lessons"
-
-%p Want to learn programming? Here are some lessons that we've put online.
-
-%ul#lessons
- - @lessons.each do |lesson|
- %li
- .info
- .title
- = link_to lesson.metadata["title"], lesson_path(lesson.metadata["slug"])
- = lesson.metadata["blurb"]
- .categories
- = lesson_categories lesson
-
-
diff --git a/app/views/lessons/show.html.haml b/app/views/lessons/show.html.haml
deleted file mode 100644
index 27f26e1e..00000000
--- a/app/views/lessons/show.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-- @page_class = "lesson"
-
-- content_for :title do
- = @lesson.metadata["title"]
-
-- content_for :sidebar do
- = render :partial => "shared/ask"
- = render :partial => "shared/lessons"
-
-#lesson-content
- = lesson_categories @lesson
-
- =markdown(@lesson.output)
diff --git a/app/views/mailer/_form.html.haml b/app/views/mailer/_form.html.haml
deleted file mode 100644
index 52e95c84..00000000
--- a/app/views/mailer/_form.html.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-=simple_form_for(@message, :url => mailer_path) do |f|
- =f.error_notification
- .inputs
- =f.input :subject, :hint => "Write the subject here!"
- =f.input :body, :as => :text
-
- -@emails.each do |email|
- =f.input "email[#{email}]", :as => :text, :as => :hidden, :input_html => { :value => ""}
-
- .actions
- =f.button :submit , 'Send Email', :class => "primary btn"
\ No newline at end of file
diff --git a/app/views/mailer/new.html.haml b/app/views/mailer/new.html.haml
deleted file mode 100644
index c9f04e11..00000000
--- a/app/views/mailer/new.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-%h1 Send an Email!
-= render "form"
-
-This email will send to:
--@emails.each do |email|
- = email
- = " "
\ No newline at end of file
diff --git a/app/views/message_mailer/new_message.html.haml b/app/views/message_mailer/new_message.html.haml
deleted file mode 100644
index df3f577a..00000000
--- a/app/views/message_mailer/new_message.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-=@message.body
\ No newline at end of file
diff --git a/app/views/notification/new_answer.html.haml b/app/views/notification/new_answer.html.haml
deleted file mode 100644
index 0c38fe81..00000000
--- a/app/views/notification/new_answer.html.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-Hey there! You asked a question on Hackety.com: ""
-
-Someone has replied with an answer! Check it out here: #{@url}
diff --git a/app/views/programs/index.html.haml b/app/views/programs/index.html.haml
deleted file mode 100644
index 46f0a890..00000000
--- a/app/views/programs/index.html.haml
+++ /dev/null
@@ -1,34 +0,0 @@
-- content_for :title do
- - if @user
- #{@user.username}'s Programs
- - else
- Programs
-
-- unless @featured.blank? or @user
- #featured.programs
- .heading
- %h3 Featured
- .description Our favorite selection of projects.
-
- %ul
- - @featured.each do |program|
- %li
- .title= program_link program
- .author= author_link program.author_username, program
-
-#all-programs.programs
- - unless @user
- .heading
- %h3 All Programs
- .description Every program uploaded by our users!
-
- %ul
- - @programs.each do |program|
- %li
- .title= program_link program
- .author= author_link program.author_username, program
-
-- if @user
- %ul.inline-menu.bottom-nav
- %li= link_to "All Programs", programs_path
- %li= link_to "#{@user.username}'s profile", user_path(@user)
diff --git a/app/views/programs/show.html.haml b/app/views/programs/show.html.haml
deleted file mode 100644
index b5ff2b1b..00000000
--- a/app/views/programs/show.html.haml
+++ /dev/null
@@ -1,30 +0,0 @@
-- unless current_user
- - content_for :alert do
- .alert-message.block-message.info
- %p
- = author_link @program.author_username
- and many others are using
- %strong Hackety Hack
- to learn how to code.
- %p Hackety Hack is a free program for Windows, Mac OS X and Linux that can teach you how to make games, applications and more and share those programs with your friends. You can ask other budding programmers questions and follow them to see what code they're working on through the Hackety Hack website.
-
- = link_to "Sign up", new_user_registration_path, :class => "btn primary"
- = link_to "Learn More", root_path, :class => "btn"
-
-- content_for :title do
- = @program.title
-
-- content_for :subtitle do
- %small
- by
- = link_to @program.author_username, user_path(@program.author_username)
-
-.description
- %p= @program.description
-
-#program
- %pre.prettyprint= @program.source_code
-
- %ul.inline-menu.bottom-nav
- %li= link_to "#{@program.author_username}'s programs", user_programs_path(@program.author_username)
- %li= link_to "All Programs", programs_path
diff --git a/app/views/questions/_form.html.haml b/app/views/questions/_form.html.haml
deleted file mode 100644
index de4eec3f..00000000
--- a/app/views/questions/_form.html.haml
+++ /dev/null
@@ -1,12 +0,0 @@
-= simple_form_for(resource, :url => @form_url) do |f|
- = f.error_notification
-
- .inputs
- = f.input :title, :hint => "What's your question?"
- - if @support
- = f.hidden_field :support, :value => true
- = f.input :description, :as => :text,
- :hint => "Provide some details about your problem to help diagnose it You can format your input with Markdown".html_safe
-
- .actions
- = f.button :submit , 'Ask Everyone', :class => "primary btn"
diff --git a/app/views/questions/_list.html.haml b/app/views/questions/_list.html.haml
deleted file mode 100644
index fe52303d..00000000
--- a/app/views/questions/_list.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-%li.item{:id=>question.id, :class => question.answers.count > 0 ? (question.solution_id.nil? ? "answered" : "accepted") : "unanswered"}
- .answer-count
- %h3= question.answers.count
- #{question.answers.count == 1 ? "answer" : "answers"}
- .summary
- %h2.title= link_to question.title, resource_path(question)
- .meta
- Asked by
- %span.name= link_to question.user.username, user_path(question.user)
-
- %span.date= time_ago_in_words(question.created_at)
- ago
- .description= truncate(question.description, :length => 150)
- - if current_user && current_user.moderator?
- %div.move_question= link_to "Move to #{question.support? ? 'Questions' : 'Support'} »", question_path(question, :question => { :support => (question.support? ? "false" : "true") }), :method => :put, :class => "btn small info"
diff --git a/app/views/questions/edit.html.haml b/app/views/questions/edit.html.haml
deleted file mode 100644
index 76006cdd..00000000
--- a/app/views/questions/edit.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-- content_for :title do
- = "Editing #{resource.title}"
-
-= render 'form'
diff --git a/app/views/questions/index.atom.builder b/app/views/questions/index.atom.builder
deleted file mode 100644
index 09f14748..00000000
--- a/app/views/questions/index.atom.builder
+++ /dev/null
@@ -1,19 +0,0 @@
-atom_feed :language => 'en-US' do |feed|
- feed.title "Hackety Hack Questions"
- feed.updated @updated
-
- @questions.each do |question|
- feed.entry( question ) do |entry|
- entry.url question_url(question)
- entry.title question.title
- entry.content question.description
-
- # the strftime is needed to work with Google Reader.
- entry.updated(question.updated_at.strftime("%Y-%m-%dT%H:%M:%SZ"))
-
- entry.author do |author|
- author.name question.user.username
- end
- end
- end
-end
\ No newline at end of file
diff --git a/app/views/questions/index.html.haml b/app/views/questions/index.html.haml
deleted file mode 100644
index 41739204..00000000
--- a/app/views/questions/index.html.haml
+++ /dev/null
@@ -1,29 +0,0 @@
-- content_for :head do
- - if @support
- = auto_discovery_link_tag :atom, support_questions_url(format: :atom)
- - else
- = auto_discovery_link_tag :atom, questions_url(format: :atom)
-
-- content_for :title do
- -if @support
- Support Questions
- -else
- Questions
-
-- content_for :sidebar do
- = render :partial => "shared/ask"
- - if @support
- = render :partial => "shared/questions_blurb"
- - else
- = render :partial => "shared/support_blurb"
-
-- content_for :feed do
- - if @support
- = link_to "Feed", support_questions_url(format: :atom)
- - else
- = link_to "Feed", questions_url(format: :atom)
-
-%ul.questions
- = render :partial => "list", :collection => collection, :as => :question
-
-= will_paginate(@questions, renderer: @support ? PrefixLinkRenderer.new('/support') : nil)
diff --git a/app/views/questions/new.html.haml b/app/views/questions/new.html.haml
deleted file mode 100644
index fc5dcc8a..00000000
--- a/app/views/questions/new.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-- content_for :title do
- New Question
-
-= render 'form'
diff --git a/app/views/questions/show.html.haml b/app/views/questions/show.html.haml
deleted file mode 100644
index b53a34b1..00000000
--- a/app/views/questions/show.html.haml
+++ /dev/null
@@ -1,37 +0,0 @@
-- @content_class = "question"
-- content_for :title do
- = resource.title
-
-- content_for :sidebar do
- - if can? :update, resource
- = link_to 'Edit', edit_resource_path, :class => "edit btn"
- - if can? :destroy, resource
- = link_to 'Delete', resource_path, :class => "delete btn", :confirm => 'Are you sure?', :method => :delete
-
-
- = render :partial => "shared/ask"
- - if @support
- = render :partial => "shared/questions_blurb"
- - else
- = render :partial => "shared/support_blurb"
-
-.meta
- Asked
- - if resource.user
- by
- %span.name= link_to resource.user.username, user_path(resource.user)
-
- %span.date= time_ago_in_words(resource.created_at)
- ago
-
-
-.description
- =markdown(resource.description)
-
-%h2= pluralize(resource.answers.count, "response")
-%ul.answers
- = render :partial => "answers/list", :collection => resource.answers
-
-- if can? :create, Answer
- = render :partial => "answers/short_answer"
-
diff --git a/app/views/shared/_ask.html.haml b/app/views/shared/_ask.html.haml
deleted file mode 100644
index 7f7efda5..00000000
--- a/app/views/shared/_ask.html.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-%section.ask
- %h2 Have A Question?
- %p Ask away! No question is too big or too small.
- - if current_user
- - if @support
- = link_to "Ask a Question", new_question_path(:support => true), :class => "btn success"
- - else
- = link_to "Ask a Question", new_question_path, :class => "btn success"
- - else
- %p Log in to ask a question
- = link_to "Log In", login_path, :class => "btn success"
diff --git a/app/views/shared/_lessons.html.haml b/app/views/shared/_lessons.html.haml
deleted file mode 100644
index 93419a2d..00000000
--- a/app/views/shared/_lessons.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%section.lessons
- %h2 Want to help?
- %p Help us create new lessons, or update existing ones. Check out the Lessons project on Github below:
- = link_to "Hackety Hack Lessons on Github", "https://github.com/hacketyhack/hackety_hack-lessons"
\ No newline at end of file
diff --git a/app/views/shared/_questions_blurb.html.haml b/app/views/shared/_questions_blurb.html.haml
deleted file mode 100644
index fdd9f1f0..00000000
--- a/app/views/shared/_questions_blurb.html.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-%section.support
- %h2 Ruby Questions
- %p Programming problem got you stumped? Find Ruby a bit confusing? Check out the #{link_to "questions section", questions_path}.
diff --git a/app/views/shared/_recent.html.haml b/app/views/shared/_recent.html.haml
deleted file mode 100644
index 9a7460aa..00000000
--- a/app/views/shared/_recent.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-%section.recent
- %h2 Recent Posts
- %ul
- - BlogPost.sort("created_at DESC").limit(5).each do |post|
- %li
- = link_to post.title, blog_path(post)
diff --git a/app/views/shared/_support_blurb.html.haml b/app/views/shared/_support_blurb.html.haml
deleted file mode 100644
index 2c526e65..00000000
--- a/app/views/shared/_support_blurb.html.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-%section.support
- %h2 Support
- %p Having a problem running Hackety Hack? Found a bug? Check out the #{link_to "support section", support_questions_path}
diff --git a/app/views/shared/menu/_footer.html.haml b/app/views/shared/menu/_footer.html.haml
deleted file mode 100644
index 2cd33abe..00000000
--- a/app/views/shared/menu/_footer.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-= semantic_menu :class => "pills" do |root|
- - root.add "Home", root_path
- - root.add "Blog", blog_index_path
- - root.add "Questions", questions_path
- - root.add "Programs", programs_path
- - root.add "FAQ", faq_path
- - root.add "Support", support_questions_path
-
diff --git a/app/views/shared/menu/_main.html.haml b/app/views/shared/menu/_main.html.haml
deleted file mode 100644
index 41130bc5..00000000
--- a/app/views/shared/menu/_main.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-= semantic_menu :class => "nav" do |root|
- - root.add "Blog", blog_index_path
- - root.add "Questions", questions_path
- - root.add "Lessons", lessons_path
- - root.add "Programs", programs_path
- - root.add "FAQ", faq_path
- - root.add "Support", support_questions_path
- - root.add "Contribute", contribute_path
diff --git a/app/views/shared/menu/_user.html.haml b/app/views/shared/menu/_user.html.haml
deleted file mode 100644
index 2e4de22e..00000000
--- a/app/views/shared/menu/_user.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-= semantic_menu :class => "nav secondary-nav" do |root|
- - if current_user
- - if current_user.moderator
- - root.add "Send an Email", users_index_path
- - root.add current_user.username, user_path(current_user)
- - root.add "Log Out", logout_path
- - else
- - root.add "Log In", login_path
- - root.add "Sign Up", new_user_registration_path
diff --git a/app/views/static/api_root.html.haml b/app/views/static/api_root.html.haml
deleted file mode 100644
index d4895c46..00000000
--- a/app/views/static/api_root.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-= title "Welcome"
-
-%p For a list of the relations we've defined for this API, go #{link_to("here", rels_path, :rel => "/rels/rel-index")}.
-%p You can find the latest released version of Hackety Hack #{link_to("here", newest_version_path, :rel => "/rels/current-application-version")}.
-
-%h2 Programs
-
-%p For a list of programs our users have made, go #{link_to("here", programs_path, :rel => "/rels/program-index")}.
-%p To make a new program, you can find a form #{link_to("here", new_program_path, :rel => "/rels/program-new")}.
-
diff --git a/app/views/static/contribute.html.haml b/app/views/static/contribute.html.haml
deleted file mode 100644
index bac61372..00000000
--- a/app/views/static/contribute.html.haml
+++ /dev/null
@@ -1,26 +0,0 @@
-- content_for :sidebar do
- = render :partial => "shared/ask"
- = render :partial => "shared/support_blurb"
-
-- content_for :title do
- Contribute
-
-#Contribute
- :markdown
- Volunteers build Hackty Hack - want to help and join us to improve Hackety Hack?
-
- ## Want to help developing Hackety Hack?
-
- Both this web application and the Hackety Hack program itself are open source projects. This means volunteers build them, but it also means that you can jump in and help out! How cool would that be, right?
-
- You can help out with the development of this web application [here](https://github.com/hacketyhack/hackety-hack.com) and with the the development of the Hackety Hack program [here](https://github.com/hacketyhack/hacketyhack).
-
- Every contribution is very welcome! It can be a fixed typo, an issue report or an entirely new feature - that is up to you! Thanks in advance!
-
- ## Want to help us translate Hackety Hack?
-
- Hello everyone!
-
- We are in the process of translating Hackety Hack into as many foreign languages as possible so that people around the world can use the site with ease.
-
- If you are bilingual and interested in helping us make Hackety Hack a truly global phenomenon, accessible by all regardless of location or nationality and make learning Ruby even more fun, then please [sign up here!](http://crowdin.net/project/hackety-hackcom/invite)
diff --git a/app/views/static/download.html.haml b/app/views/static/download.html.haml
deleted file mode 100644
index 45181315..00000000
--- a/app/views/static/download.html.haml
+++ /dev/null
@@ -1,20 +0,0 @@
-%h2 Download
-
-%p Click the big green button below to start your download.
-
-%p
- %a.btn.primary.large{:href => @download_url}
- %b.download Download Now
- %br
- %span.version
- Version 1.0.1 for #{@platform}
-
-%p Not on #{@platform}? Click #{link_to "here", downloads_path(@other_platforms.first)} for #{@other_platforms.first} and #{link_to "here", downloads_path(@other_platforms.second)} for #{@other_platforms.second}.
-%br/
-
-%h3 Sign up
-
-%p Once you've got that going, you should sign up for the web site. You can use the site to get help, share your programs with others, and other fun stuff!
-
-%br/
-= render :partial => "users/form", :locals => @locals
diff --git a/app/views/static/faq.html.haml b/app/views/static/faq.html.haml
deleted file mode 100644
index 8c2bbcb7..00000000
--- a/app/views/static/faq.html.haml
+++ /dev/null
@@ -1,85 +0,0 @@
-- content_for :sidebar do
- = render :partial => "shared/ask"
- = render :partial => "shared/support_blurb"
-
-- content_for :title do
- Frequently Asked Questions
-
-#faq
- :markdown
- ##My install of Hackety-Hack crashes?
-
- Yes, we noticed that. Sorry. Multi-platform weirdness and all that. There are some known problems with HH on Windows Vista and XP, and they are being worked on.
-
- Always check you have the latest updates at the [Hackety Hack Downloads page](http://hackety-hack.com/downloads) just in case something has been fixed.
-
- Also, some Windows users have found that moving HH to C:\apps instead of C:\Programs.... makes HH a little happier.
-
- ##What tutorials are available after I finish 'Beyond Shoes'?
-
- There will be more Tutorials added in the future. Meanwhile may I direct your curious minds to the following excellent resources on learning more about Shoes, Ruby and programming:
-
- + [Shoes website](http://shoesrb.com "Shoooooes!") : links to several things Shoes-y, some repeated below.
- + [Shoes Manual](http://shoesrb.com/manual/Hello.html "Shoes Manual!") : a light waltz through Shoes. This is available through Hackety Hack's 'Help' menu;
- + [Nobody Knows Shoes](http://cloud.github.com/downloads/shoes/shoes/nks.pdf "Nobody Knows Shoes, with Midas") : _why's tutorial on Shoes and all the useful bits in it. Many, many, bits.
- + Chris Pine's [Learn to program](http://pine.fm/LearnToProgram "Learn to program 1st Ed") : 1st Edition is online for free. 2nd Edition Book it as [Pragmatic Programmers](pragprog.com/LearnToProgram "Pragprog - Learn to Program 2nd Ed") is bigger, better and has many more examples)
- + Poignant Guide to Ruby : the delightful exploration of ruby with some foxes, chunky bacon, and more of _why's stylish examples. [get it here](http://cloud.github.com/downloads/devyn/shoes-web/whys-poignant-guide-to-ruby.pdf "Poignant guide to Ruby")
- + [Learn Ruby the Hard Way](http://ruby.learncodethehardway.org/book/) : Don't let the title scare you. This book does not assume any programming skills and yet it's great for novices.
-
- ##Why can't I see the Turtle?
-
- The tutorial on Turtle graphics uses `Turtle.draw` which gives the Turtle super-speed: it does the job and hides the turtle before you even see it. Turtles can be surprisingly fast.
-
- Change `Turtle.draw` to `Turtle.start` to see the turtle (whom I have nicknamed 'Chell') perform each of your commands. You can also do things like saying 'Chell! I command thee!' before each step, although it will not change the program outcome. But you might enjoy it.
-
- ##Where are my programs and samples stored?
-
- *Linux*
-
- + My Programs: your home directory, in the hidden folder '.hacketyhack' (eg: \users\jsmith\\.hacketyhack).
- + Samples are in the 'samples' directory in the My Programs directory.
-
- *Mac OS X*
-
- + My Programs: your home directory, in the hidden folder '.hacketyhack' (eg: \Users\jsmith\\.hacketyhack). Quickest way to get there using the Finder menus > Go > Go to Folder > type `~/.hacketyhack/` then click 'Go'. The files are plain text and can be opened in any text editor.
- + Samples are in the Hackety Hack Package (/Applications then right-click on Hackety Hack > Show Package Contents > Contents > MacOS > app > samples)
-
- *Windows Vista / XP*
-
- + My Programs: In your _username_ 'Documents and Settings' folder (eg: C:\Documents and Settings\jsmith\\.hacketyhack). For the interested, the '.' at the start is left over from Linux and Mac and would otherwise make this folder hidden. But it's not on Windows.
- + Samples are under the Shoes folder in 'Program Files' (eg: C:\Program Files\Common Files\Shoes\0.r1514\samples)
-
- ##How do I upload my programs to hackety-hack.com
-
- 1. Create an account on hackety-hack.com. Start by clicking #{link_to 'here', new_user_registration_path}
- 2. In the HH application look for the 'Preferences' icon on the lower left side of the window
- 3. Enter your hackety-hack.com account name and password then click 'Save'
- 4. Now, when you create or edit a program, the 'Upload' button will be available to automatically upload the program to your page.
-
- ##What is the 'Preferences' page and the 2 text boxes?
-
- The 'Preferences' are for you to type your Hackety-hack.com account details, for uploading files to your hackety-hack.com profile page.
- This is a way for you to show others what you are doing, and a way of sharing code if you are having problems.
- When you enter any programs there will be an 'Upload' button in the editor (next to Run) which you can use to, well, *upload* the program to your Hackety-Hack.com profile page (on the hackety-hack.com site, click 'My Page' at top-right)
-
- ##Where is my page on hackety-hack.com?
-
- Check the upper right hand side of the page: when you're logged in, it has your username. Click it to go to your page.
-
- You can usually click on another user's name to get to their page, if you're elsewhere on the site.
-
- ##If I change a sample, does it change the original?
-
- No. When you click on a Sample program, it is loaded into the Editor and you can change as much of it as you like. When you exit, the sample is not changed.
-
- You can also click the 'Copy' button in the Editor (next to 'Run') then give it a new name and it will become one of your programs. You can then edit your version as much as you wish.
-
- (**NOTE**: _There is a small bug you might experience - after the 'Copy', Hackety Hack temporarily renames the sample program as well. The sample reverts to it's correct name after HH is closed/reopened_)
-
- ## Where'd you get the sweet icons?
-
- [Raindropmemory](http://raindropmemory.deviantart.com/#/d1xzrog) on Deviant Art made them. They're super great, aren't they?
-
- ## Thanks!
-
- Special thanks goes out to Eric Affleck for writing this FAQ.
\ No newline at end of file
diff --git a/app/views/static/root.html.haml b/app/views/static/root.html.haml
deleted file mode 100644
index 6271f045..00000000
--- a/app/views/static/root.html.haml
+++ /dev/null
@@ -1,33 +0,0 @@
-- @page_class = "home"
-
-- content_for :top do
- #home-splash
- .container
- = image_tag "splash.jpg"
-
-%section#download
- %h1 Start Here!
- .content
- %p
- Hackety Hack will teach you the absolute basics of programming from the ground up. No previous programming experience is needed!
- %p
- With Hackety Hack, you'll learn the Ruby programming language. Ruby is used for all kinds of programs, including desktop applications and websites.
- %a.btn.primary.large{:href => "/downloads/latest/#{@platform}"}
- %b.download Download Now
- %br
- %span.version
- Version 1.0.1
- - if @platform
- for #{@platform}
-
-%section#explore
- %h1 Learn and Explore
- .content
- %p Hackety Hack uses the #{link_to "Shoes", "http://shoesrb.com/"} toolkit to make it really easy and fun to build graphical interfaces. Several lessons and example programs are provided, showing you how to make all kinds of fun things!
- %p Check out what other people are doing with Hackety Hack! The #{link_to "Programs", programs_path} section is chock full of fun projects from other Hackety users. You can even upload your own! Put your account information into the Hackety Hack app, and you'll be able to share all the programs you create.
-
-%section#ask
- %h1 Help is Here
- .content
- %p Got a question about Hackety Hack? Check out our #{link_to "FAQ", "faq"}. If that doesn't cover it ask for support #{link_to "here", support_questions_path}.
- %p Got a question about programming in general? Ask away in the #{link_to "Questions", questions_path} section. No question to big or small, the community is here to help you out.
diff --git a/app/views/users/_form.html.haml b/app/views/users/_form.html.haml
deleted file mode 100644
index 49e9154b..00000000
--- a/app/views/users/_form.html.haml
+++ /dev/null
@@ -1,17 +0,0 @@
-- submit_label ||= "Update"
-= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
- = f.error_notification
- .inputs
- = f.input :username, :autofocus => true
- = f.input :email
- .inputs
- - pwd_options = resource.new_record? ? {} : {:hint => "Leave it blank if you don't want to change it"}
- = f.input :password, pwd_options.merge({:required => false})
- = f.input :password_confirmation, :required => false
- .inputs
- = f.input :about, :as => :text
- - unless resource.new_record?
- .inputs
- = f.input :current_password, :required => true, :hint => "We need your password to update your account."
- .actions
- = f.button :submit, submit_label, :class => "btn primary"
diff --git a/app/views/users/deleted_user.html.haml b/app/views/users/deleted_user.html.haml
deleted file mode 100644
index 10721f64..00000000
--- a/app/views/users/deleted_user.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-%h2 This user has been deleted, sorry
\ No newline at end of file
diff --git a/app/views/users/followers.html.haml b/app/views/users/followers.html.haml
deleted file mode 100644
index 61b43f7c..00000000
--- a/app/views/users/followers.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-%h1 #{resource.username}'s followers:
-%ul
-- resource.followers.each do |follower|
- %li
- %a{:href=> resource_path(follower)}= follower.username
\ No newline at end of file
diff --git a/app/views/users/following.html.haml b/app/views/users/following.html.haml
deleted file mode 100644
index 0f8fc492..00000000
--- a/app/views/users/following.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-%h1 #{resource.username} is following:
-%ul
-- resource.following.each do |followee|
- %li
- %a{:href=> resource_path(followee)}= followee.username
\ No newline at end of file
diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml
deleted file mode 100644
index 2a365243..00000000
--- a/app/views/users/index.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-=link_to "Create a diffusion", mailer_path(:user => User.all)
-%ul#user-list
- - @users.each do |user|
- %li
- .title= user.username
- = link_to "Email him", mailer_path(:user => user), :class => "btn small info"
-
-= will_paginate @users
\ No newline at end of file
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
deleted file mode 100644
index d4a79eb7..00000000
--- a/app/views/users/show.html.haml
+++ /dev/null
@@ -1,55 +0,0 @@
-- content_for :title do
- = "#{resource.username}'s Profile"
-
--content_for :sidebar do
- %section.about-user
- %img{:src => gravatar_url(resource.email)}
- - if current_user && current_user != resource
- -if current_user.following?(resource)
- = simple_form_for(resource, :url => resource_path(current_user) + '/unfollow', :method=>:post) do |f|
- = f.hidden_field :followee, :value => resource.id
- = f.button :submit, :value => "Unfollow", :class => "primary btn"
- - else
- = simple_form_for(resource, :url => resource_path(current_user) + '/follow', :method=>:post) do |f|
- = f.hidden_field :followee, :value => resource.id
- = f.button :submit, :value => "Follow", :class => "primary btn"
-
- - unless resource.about.blank?
- %p= resource.about
- %p
- = link_to pluralize(resource.programs.count, "Program"), user_programs_path(resource), :class => "user-programs"
- %p
- Following:
- =link_to resource.following.count, resource_path(resource) + "/following", :class => 'user-following'
- %p
- Followers:
- = link_to resource.followers.count, resource_path(resource) + "/followers", :class => 'user-followers'
- %hr
- - if can? :update, resource
- = link_to "Change My Settings", edit_registration_path(resource), :class => "btn success"
-
-
-- unless @user.questions.empty?
- %section.user-questions
- .heading
- %h3= pluralize(@user.questions.count, "Question")
- %ul
- - @user.questions.each do |question|
- %li
- .title
- = link_to question.title, question_path(question)
- .meta
- asked #{question.created_at.strftime("%b %e, %l:%M %p")}
-
-- unless @user.answers.empty?
- %section.user-answers
- .heading
- %h3= pluralize(@user.answers.count, "Answer")
- %ul
- - @user.answers.each do |answer|
- %li
- .description
- = answer.description.truncate(100)
- .meta
- = link_to("View Answer", answer.question)
-
diff --git a/config.ru b/config.ru
deleted file mode 100644
index 3879ea33..00000000
--- a/config.ru
+++ /dev/null
@@ -1,4 +0,0 @@
-# This file is used by Rack-based servers to start the application.
-
-require ::File.expand_path('../config/environment', __FILE__)
-run HacketyHackCom::Application
diff --git a/config/application.rb b/config/application.rb
deleted file mode 100644
index d2382e0a..00000000
--- a/config/application.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require File.expand_path('../boot', __FILE__)
-
-require 'rails/all'
-
-if defined?(Bundler)
- # If you precompile assets before deploying to production, use this line
- #Bundler.require *Rails.groups(:assets => %w(development test))
- # If you want your assets lazily compiled in production, use this line
- Bundler.require(:default, :assets, Rails.env)
-end
-
-module HacketyHackCom
- class Application < Rails::Application
- config.autoload_paths << "#{config.root}/lib" << "#{config.root}/presenters"
-
- config.encoding = "utf-8"
-
- config.filter_parameters += [:password]
-
- config.assets.enabled = true
-
- config.generators do |g|
- g.template_engine :haml
-
- # you can also specify a different test framework or ORM here
- g.test_framework :rspec, :fixture => true
- g.fixture_replacement :fabrication
- g.orm :mongo_mapper
- end
- end
-end
diff --git a/config/boot.rb b/config/boot.rb
deleted file mode 100644
index 4489e586..00000000
--- a/config/boot.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require 'rubygems'
-
-# Set up gems listed in the Gemfile.
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
diff --git a/config/config.yml.sample b/config/config.yml.sample
deleted file mode 100644
index 2ef60a26..00000000
--- a/config/config.yml.sample
+++ /dev/null
@@ -1,9 +0,0 @@
-# encoding: utf-8
-development:
- # Your secret key for verifying the integrity of signed cookies.
- # If you change this key, all old signed cookies will become invalid!
- # Make sure the secret is at least 30 characters and all random,
- # no regular words or you'll be exposed to dictionary attacks.
- # Used in config/initializers/secret_token.rb.
- # You can generate a good value for this by running `rake secret`.
- SECRET_TOKEN:
\ No newline at end of file
diff --git a/config/cucumber.yml b/config/cucumber.yml
deleted file mode 100644
index 67669be1..00000000
--- a/config/cucumber.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-<%
-rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
-rerun_opts = rerun.to_s.strip.empty? ? "--color --format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
-std_opts = "--color --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
-%>
-default: <%= std_opts %> features
-wip: --tags @wip:3 --wip features
-rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
diff --git a/config/database.yml b/config/database.yml
deleted file mode 100644
index 09cc85a2..00000000
--- a/config/database.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-# SQLite version 3.x
-# gem install sqlite3
-#
-# Ensure the SQLite 3 gem is defined in your Gemfile
-# gem 'sqlite3'
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- pool: 5
- timeout: 5000
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test: &test
- adapter: sqlite3
- database: db/test.sqlite3
- pool: 5
- timeout: 5000
-
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- pool: 5
- timeout: 5000
-
-cucumber:
- <<: *test
\ No newline at end of file
diff --git a/config/environment.rb b/config/environment.rb
deleted file mode 100644
index 0fb2941c..00000000
--- a/config/environment.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# Load the rails application
-require File.expand_path('../application', __FILE__)
-
-# Initialize the rails application
-HacketyHackCom::Application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
deleted file mode 100644
index e1189b93..00000000
--- a/config/environments/development.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-HacketyHackCom::Application.configure do
- # Settings specified here will take precedence over those in config/application.rb
-
- # In the development environment your application's code is reloaded on
- # every request. This slows down response time but is perfect for development
- # since you don't have to restart the web server when you make code changes.
- config.cache_classes = false
-
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
-
- # Show full error reports and disable caching
- config.consider_all_requests_local = true
- config.action_controller.perform_caching = false
-
- # Don't care if the mailer can't send
- config.action_mailer.raise_delivery_errors = false
-
- # Print deprecation notices to the Rails logger
- config.active_support.deprecation = :log
-
- # Only use best-standards-support built into browsers
- config.action_dispatch.best_standards_support = :builtin
-
- # Do not compress assets
- config.assets.compress = false
-
- config.action_mailer.default_url_options = { :host => 'localhost:3000' }
- config.action_mailer.delivery_method = :letter_opener
-end
diff --git a/config/environments/production.rb b/config/environments/production.rb
deleted file mode 100644
index 9562087c..00000000
--- a/config/environments/production.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-HacketyHackCom::Application.configure do
- # Settings specified here will take precedence over those in config/application.rb
-
- # Code is not reloaded between requests
- config.cache_classes = true
-
- # Full error reports are disabled and caching is turned on
- config.consider_all_requests_local = false
- config.action_controller.perform_caching = true
-
- # Disable Rails's static asset server (Apache or nginx will already do this)
- config.serve_static_assets = false
-
- # Compress JavaScripts and CSS
- config.assets.compress = true
-
- # Specifies the header that your server uses for sending files
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
-
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
- # config.force_ssl = true
-
- # See everything in the log (default is :info)
- # config.log_level = :debug
-
- # Use a different logger for distributed setups
- # config.logger = SyslogLogger.new
-
- # Use a different cache store in production
- # config.cache_store = :mem_cache_store
-
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
- # config.action_controller.asset_host = "http://assets.example.com"
-
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
- # config.assets.precompile += %w( search.js )
-
- # Disable delivery errors, bad email addresses will be ignored
- # config.action_mailer.raise_delivery_errors = false
- config.action_mailer.default_url_options = { :host => "hackety-hack.com" }
-
- # Enable threaded mode
- # config.threadsafe!
-
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
- # the I18n.default_locale when a translation can not be found)
- config.i18n.fallbacks = true
-
- # Send deprecation notices to registered listeners
- config.active_support.deprecation = :notify
-end
-
-ActionMailer::Base.smtp_settings = {
- :address => 'smtp.sendgrid.net',
- :port => '587',
- :authentication => :plain,
- :user_name => ENV['SENDGRID_USERNAME'],
- :password => ENV['SENDGRID_PASSWORD'],
- :domain => 'hackety.com'
-}
-ActionMailer::Base.delivery_method = :smtp
-
-
diff --git a/config/environments/test.rb b/config/environments/test.rb
deleted file mode 100644
index a2dc3c74..00000000
--- a/config/environments/test.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-HacketyHackCom::Application.configure do
- # Settings specified here will take precedence over those in config/application.rb
-
- # The test environment is used exclusively to run your application's
- # test suite. You never need to work with it otherwise. Remember that
- # your test database is "scratch space" for the test suite and is wiped
- # and recreated between test runs. Don't rely on the data there!
- config.cache_classes = true
-
- # Configure static asset server for tests with Cache-Control for performance
- config.serve_static_assets = true
- config.static_cache_control = "public, max-age=3600"
-
- # Log error messages when you accidentally call methods on nil
- config.whiny_nils = true
-
- # Show full error reports and disable caching
- config.consider_all_requests_local = true
- config.action_controller.perform_caching = false
-
- # Raise exceptions instead of rendering exception templates
- config.action_dispatch.show_exceptions = false
-
- # Disable request forgery protection in test environment
- config.action_controller.allow_forgery_protection = false
-
- # Tell Action Mailer not to deliver emails to the real world.
- # The :test delivery method accumulates sent emails in the
- # ActionMailer::Base.deliveries array.
- config.action_mailer.delivery_method = :test
-
- # Use SQL instead of Active Record's schema dumper when creating the test database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
-
- # Print deprecation notices to the stderr
- config.active_support.deprecation = :stderr
-end
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
deleted file mode 100644
index 59385cdf..00000000
--- a/config/initializers/backtrace_silencers.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
-# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
-
-# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
diff --git a/config/initializers/cve_fix.rb b/config/initializers/cve_fix.rb
deleted file mode 100644
index f8788d01..00000000
--- a/config/initializers/cve_fix.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML)
-
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
deleted file mode 100644
index 0b2e519b..00000000
--- a/config/initializers/devise.rb
+++ /dev/null
@@ -1,193 +0,0 @@
-# Use this hook to configure devise mailer, warden hooks and so forth. The first
-# four configuration values can also be set straight in your models.
-Devise.setup do |config|
- # ==> Mailer Configuration
- # Configure the e-mail address which will be shown in DeviseMailer.
- config.mailer_sender = "do-not-reply@hackety-hack.com"
-
- # Configure the class responsible to send e-mails.
- # config.mailer = "Devise::Mailer"
-
- # ==> ORM configuration
- # Load and configure the ORM. Supports :active_record (default) and
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
- # available as additional gems.
- require 'devise/orm/mongo_mapper'
-
- # ==> Configuration for any authentication mechanism
- # Configure which keys are used when authenticating a user. The default is
- # just :email. You can configure it to use [:username, :subdomain], so for
- # authenticating a user, both parameters are required. Remember that those
- # parameters are used only when authenticating and not when retrieving from
- # session. If you need permissions, you should implement that in a before filter.
- # You can also supply a hash where the value is a boolean determining whether
- # or not authentication should be aborted when the value is not present.
- config.authentication_keys = [ :username ]
-
- # Configure parameters from the request object used for authentication. Each entry
- # given should be a request method and it will automatically be passed to the
- # find_for_authentication method and considered in your model lookup. For instance,
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
- # The same considerations mentioned for authentication_keys also apply to request_keys.
- # config.request_keys = []
-
- # Configure which authentication keys should be case-insensitive.
- # These keys will be downcased upon creating or modifying a user and when used
- # to authenticate or find a user. Default is :email.
- config.case_insensitive_keys = [ :email, :username ]
-
- # Configure which authentication keys should have whitespace stripped.
- # These keys will have whitespace before and after removed upon creating or
- # modifying a user and when used to authenticate or find a user. Default is :email.
- config.strip_whitespace_keys = [ :email, :username ]
-
- # Tell if authentication through request.params is enabled. True by default.
- # config.params_authenticatable = true
-
- # Tell if authentication through HTTP Basic Auth is enabled. False by default.
- # config.http_authenticatable = false
-
- # If http headers should be returned for AJAX requests. True by default.
- # config.http_authenticatable_on_xhr = true
-
- # The realm used in Http Basic Authentication. "Application" by default.
- # config.http_authentication_realm = "Application"
-
- # It will change confirmation, password recovery and other workflows
- # to behave the same regardless if the e-mail provided was right or wrong.
- # Does not affect registerable.
- # config.paranoid = true
-
- # ==> Configuration for :database_authenticatable
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
- # using other encryptors, it sets how many times you want the password re-encrypted.
- config.stretches = 10
-
- # Setup a pepper to generate the encrypted password.
- # config.pepper = "4a818140cd08e18cc871b1e36509f6f9066975bdf9ffa2e26c02d6bcd46b9e17614108a411c88c7dfd0aa83a864dde63a84fc27becf32d02ff194f2abd235138"
-
- # ==> Configuration for :confirmable
- # The time you want to give your user to confirm his account. During this time
- # he will be able to access your application without confirming. Default is 0.days
- # When confirm_within is zero, the user won't be able to sign in without confirming.
- # You can use this to let your user access some features of your application
- # without confirming the account, but blocking it after a certain period
- # (ie 2 days).
- # config.allow_unconfirmed_access_for = 2.days
-
- # Defines which key will be used when confirming an account
- # config.confirmation_keys = [ :email ]
-
- # ==> Configuration for :rememberable
- # The time the user will be remembered without asking for credentials again.
- # config.remember_for = 2.weeks
-
- # If true, extends the user's remember period when remembered via cookie.
- # config.extend_remember_period = false
-
- # Options to be passed to the created cookie. For instance, you can set
- # :secure => true in order to force SSL only cookies.
- # config.cookie_options = {}
-
- # ==> Configuration for :validatable
- # Range for password length. Default is 6..128.
- # config.password_length = 6..128
-
- # Regex to use to validate the email address
- config.email_regexp = /([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})/i
-
- # ==> Configuration for :timeoutable
- # The time you want to timeout the user session without activity. After this
- # time the user will be asked for credentials again. Default is 30 minutes.
- # config.timeout_in = 30.minutes
-
- # ==> Configuration for :lockable
- # Defines which strategy will be used to lock an account.
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
- # :none = No lock strategy. You should handle locking by yourself.
- # config.lock_strategy = :failed_attempts
-
- # Defines which key will be used when locking and unlocking an account
- # config.unlock_keys = [ :email ]
-
- # Defines which strategy will be used to unlock an account.
- # :email = Sends an unlock link to the user email
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
- # :both = Enables both strategies
- # :none = No unlock strategy. You should handle unlocking by yourself.
- # config.unlock_strategy = :both
-
- # Number of authentication tries before locking an account if lock_strategy
- # is failed attempts.
- # config.maximum_attempts = 20
-
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
- # config.unlock_in = 1.hour
-
- # ==> Configuration for :recoverable
- #
- # Defines which key will be used when recovering the password for an account
- # config.reset_password_keys = [ :email ]
-
- # Time interval you can reset your password with a reset password key.
- # Don't put a too small interval or your users won't have the time to
- # change their passwords.
- config.reset_password_within = 2.hours
-
- # ==> Configuration for :encryptable
- # Allow you to use another encryption algorithm besides bcrypt (default). You can use
- # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
- # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
- # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
- # REST_AUTH_SITE_KEY to pepper)
- # config.encryptor = :sha512
-
- # ==> Configuration for :token_authenticatable
- # Defines name of the authentication token params key
- # config.token_authentication_key = :auth_token
-
- # ==> Scopes configuration
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
- # "users/sessions/new". It's turned off by default because it's slower if you
- # are using only default views.
- # config.scoped_views = false
-
- # Configure the default scope given to Warden. By default it's the first
- # devise role declared in your routes (usually :user).
- # config.default_scope = :user
-
- # Configure sign_out behavior.
- # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
- # The default is true, which means any logout action will sign out all active scopes.
- # config.sign_out_all_scopes = true
-
- # ==> Navigation configuration
- # Lists the formats that should be treated as navigational. Formats like
- # :html, should redirect to the sign in page when the user does not have
- # access, but formats like :xml or :json, should return 401.
- #
- # If you have any extra navigational formats, like :iphone or :mobile, you
- # should add them to the navigational formats lists.
- #
- # The :"*/*" and "*/*" formats below is required to match Internet
- # Explorer requests.
- # config.navigational_formats = [:"*/*", "*/*", :html]
-
- # The default HTTP method used to sign out a resource. Default is :delete.
- config.sign_out_via = :delete
-
- # ==> OmniAuth
- # Add a new OmniAuth provider. Check the wiki for more information on setting
- # up on your models and hooks.
- # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
-
- # ==> Warden configuration
- # If you want to use other strategies, that are not supported by Devise, or
- # change the failure app, you can configure them inside the config.warden block.
- #
- # config.warden do |manager|
- # manager.failure_app = AnotherApp
- # manager.intercept_401 = false
- # manager.default_strategies(:scope => :user).unshift :some_external_strategy
- # end
-end
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
deleted file mode 100644
index 9e8b0131..00000000
--- a/config/initializers/inflections.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# ActiveSupport::Inflector.inflections do |inflect|
-# inflect.plural /^(ox)$/i, '\1en'
-# inflect.singular /^(ox)en/i, '\1'
-# inflect.irregular 'person', 'people'
-# inflect.uncountable %w( fish sheep )
-# end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
deleted file mode 100644
index 72aca7e4..00000000
--- a/config/initializers/mime_types.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new mime types for use in respond_to blocks:
-# Mime::Type.register "text/richtext", :rtf
-# Mime::Type.register_alias "text/html", :iphone
diff --git a/config/initializers/mongo_mapper.rb b/config/initializers/mongo_mapper.rb
deleted file mode 100644
index 0d1f648e..00000000
--- a/config/initializers/mongo_mapper.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-if ENV['MONGOHQ_URL']
- MongoMapper.config = {
- Rails.env => { 'uri' => ENV['MONGOHQ_URL'] }
- }
-
- MongoMapper.connect(Rails.env)
-else
- MongoMapper.database = "hackety-hack-com-#{Rails.env}"
-end
diff --git a/config/initializers/pry.rb b/config/initializers/pry.rb
deleted file mode 100644
index 648b3dd8..00000000
--- a/config/initializers/pry.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-if Rails.env.development?
- silence_warnings do
- begin
- require 'pry'
- IRB = Pry
- rescue LoadError
- end
- end
-end
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
deleted file mode 100644
index 5e4aedfb..00000000
--- a/config/initializers/secret_token.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-if ENV["SECRET_TOKEN"].blank?
- if Rails.env.production?
- raise "You must set ENV[\"SECRET_TOKEN\"] in your app's config vars"
- elsif Rails.env.test?
- # Generate the key and test away
- ENV["SECRET_TOKEN"] = HacketyHackCom::Application.config.secret_token = SecureRandom.hex(30)
- else
- config_file = File.expand_path(File.join(Rails.root, '/config/config.yml'))
- unless File.exist? config_file
- require 'fileutils'
- FileUtils.cp config_file + '.sample', config_file
- end
- config = YAML.load_file(config_file)
- # Generate the key, set it for the current environment, update the yaml file and move on
- ENV["SECRET_TOKEN"] = config[Rails.env]['SECRET_TOKEN'] = SecureRandom.hex(30)
- File.open(config_file, 'w') { |file| file.write(config.to_yaml) }
- end
-end
-
-HacketyHackCom::Application.config.secret_token = ENV["SECRET_TOKEN"]
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
deleted file mode 100644
index 840e5772..00000000
--- a/config/initializers/session_store.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-HacketyHackCom::Application.config.session_store :cookie_store, :key => '_hackety-hack.com_session'
-
-# Use the database for sessions instead of the cookie-based default,
-# which shouldn't be used to store highly confidential information
-# (create the session table with "rails generate session_migration")
-# HacketyHackCom::Application.config.session_store :active_record_store
diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb
deleted file mode 100644
index 7cfda7fd..00000000
--- a/config/initializers/simple_form.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-# Use this setup block to configure all options available in SimpleForm.
-SimpleForm.setup do |config|
- # Components used by the form builder to generate a complete input. You can remove
- # any of them, change the order, or even add your own components to the stack.
- # config.components = [ :placeholder, :label_input, :hint, :error ]
- config.components = [ :placeholder, :label_input, :hint, :error ]
-
- # Default tag used on hints.
- # config.hint_tag = :span
-
- # CSS class to add to all hint tags.
- # config.hint_class = :hint
- config.hint_class = "help-inline"
-
- # CSS class used on errors.
- # config.error_class = :error
- config.error_class = "help-inline"
-
- # Default tag used on errors.
- # config.error_tag = :span
-
- # Method used to tidy up errors.
- # config.error_method = :first
-
- # Default tag used for error notification helper.
- # config.error_notification_tag = :p
-
- # CSS class to add for error notification helper.
- # config.error_notification_class = :error_notification
-
- # ID to add for error notification helper.
- # config.error_notification_id = nil
-
- # You can wrap all inputs in a pre-defined tag.
- # config.wrapper_tag = :div
- config.wrapper_tag = :div
-
- config.input_wrapper_tag = :div
- config.input_wrapper_class = 'input'
-
- # CSS class to add to all wrapper tags.
- # config.wrapper_class = :input
- config.wrapper_class = :clearfix
-
- # CSS class to add to the wrapper if the field has errors.
- # config.wrapper_error_class = :field_with_errors
- config.wrapper_error_class = :error
-
- # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
- # config.collection_wrapper_tag = nil
-
- # You can wrap each item in a collection of radio/check boxes with a tag, defaulting to span.
- # config.item_wrapper_tag = :span
-
- # Series of attempts to detect a default label method for collection.
- # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
-
- # Series of attempts to detect a default value method for collection.
- # config.collection_value_methods = [ :id, :to_s ]
-
- # How the label text should be generated altogether with the required text.
- # config.label_text = lambda { |label, required| "#{required} #{label}" }
- config.label_text = lambda { |label, required| "#{label} #{required}" }
-
- # You can define the class to use on all labels. Default is nil.
- # config.label_class = nil
-
- # You can define the class to use on all forms. Default is simple_form.
- # config.form_class = :simple_form
-
- # Whether attributes are required by default (or not). Default is true.
- # config.required_by_default = true
-
- # Tell browsers whether to use default HTML5 validations (novalidate option).
- # Default is enabled.
- # config.browser_validations = true
-
- # Determines whether HTML5 types (:email, :url, :search, :tel) and attributes
- # (e.g. required) are used or not. True by default.
- # Having this on in non-HTML5 compliant sites can cause odd behavior in
- # HTML5-aware browsers such as Chrome.
- # config.html5 = true
-
- # Custom mappings for input types. This should be a hash containing a regexp
- # to match as key, and the input type that will be used when the field name
- # matches the regexp as value.
- # config.input_mappings = { /count/ => :integer }
-
- # Collection of methods to detect if a file type was given.
- # config.file_methods = [ :mounted_as, :file?, :public_filename ]
-
- # Default priority for time_zone inputs.
- # config.time_zone_priority = nil
-
- # Default priority for country inputs.
- # config.country_priority = nil
-
- # Default size for text inputs.
- # config.default_input_size = 50
-
- # When false, do not use translations for labels, hints or placeholders.
- # config.translate = true
-end
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
deleted file mode 100644
index da4fb076..00000000
--- a/config/initializers/wrap_parameters.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# Be sure to restart your server when you modify this file.
-#
-# This file contains settings for ActionController::ParamsWrapper which
-# is enabled by default.
-
-# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
-ActiveSupport.on_load(:action_controller) do
- wrap_parameters :format => [:json]
-end
-
-# Disable root element in JSON by default.
-ActiveSupport.on_load(:active_record) do
- self.include_root_in_json = false
-end
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
deleted file mode 100644
index 93016092..00000000
--- a/config/locales/devise.en.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
-
-en:
- errors:
- messages:
- expired: "has expired, please request a new one"
- not_found: "not found"
- already_confirmed: "was already confirmed, please try signing in"
- not_locked: "was not locked"
- not_saved:
- one: "1 error prohibited this %{resource} from being saved:"
- other: "%{count} errors prohibited this %{resource} from being saved:"
-
- devise:
- failure:
- already_authenticated: 'You are already signed in.'
- unauthenticated: 'You need to sign in or sign up before continuing.'
- unconfirmed: 'You have to confirm your account before continuing.'
- locked: 'Your account is locked.'
- not_found_in_database: 'Invalid email or password.'
- invalid: 'Invalid email or password.'
- invalid_token: 'Invalid authentication token.'
- timeout: 'Your session expired, please sign in again to continue.'
- inactive: 'Your account was not activated yet.'
- sessions:
- signed_in: 'Signed in successfully.'
- signed_out: 'Signed out successfully.'
- passwords:
- send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
- updated: 'Your password was changed successfully. You are now signed in.'
- send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
- confirmations:
- send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
- send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
- confirmed: 'Your account was successfully confirmed. You are now signed in.'
- registrations:
- signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
- signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
- signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
- unlocks:
- send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
- unlocked: 'Your account was successfully unlocked. You are now signed in.'
- send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
- omniauth_callbacks:
- success: 'Successfully authorized from %{kind} account.'
- failure: 'Could not authorize you from %{kind} because "%{reason}".'
- mailer:
- confirmation_instructions:
- subject: 'Confirmation instructions'
- reset_password_instructions:
- subject: 'Reset password instructions'
- unlock_instructions:
- subject: 'Unlock Instructions'
diff --git a/config/locales/en.yml b/config/locales/en.yml
deleted file mode 100644
index 179c14ca..00000000
--- a/config/locales/en.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
-
-en:
- hello: "Hello world"
diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml
deleted file mode 100644
index 409e2651..00000000
--- a/config/locales/simple_form.en.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-en:
- simple_form:
- "yes": 'Yes'
- "no": 'No'
- required:
- text: 'required'
- mark: '*'
- # You can uncomment the line below if you need to overwrite the whole required html.
- # When using html, text and mark won't be used.
- # html: '*'
- error_notification:
- default_message: "Some errors were found, please take a look:"
- # Labels and hints examples
- # labels:
- # password: 'Password'
- # user:
- # new:
- # email: 'E-mail para efetuar o sign in.'
- # edit:
- # email: 'E-mail.'
- # hints:
- # username: 'User name to sign in.'
- # password: 'No special characters, please.'
-
diff --git a/config/routes.rb b/config/routes.rb
deleted file mode 100644
index e46d05dc..00000000
--- a/config/routes.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-HacketyHackCom::Application.routes.draw do
-
- get "users/index"
-
- match 'mailer' => 'mailer#new', :as => 'mailer', :via => :get
- match 'mailer' => 'mailer#create', :as => 'mailer', :via => :post
- get 'users/deleted_user', :to => 'users#deleted_user'
-
- resources :lessons, :only => [:index, :show]
-
- resources :questions do
- resources :answers
- end
-
- resources :blog, :controller => "blog" do
- match "admin", :on => :collection, :controller => "blog", :action => "admin"
- end
-
- get "/downloads/latest/:platform", :to => "static#download", :as => 'downloads'
- get "/downloads/latest", :to => "static#download", :as => 'download'
- match "/download" => redirect("/downloads/latest")
-
- scope '/support', :as => 'support' do
- resources :questions, :controller => 'questions' do
- resources :answers
- end
- end
-
- constraints(ApiConstraint) do
- match '/' => 'static#api_root'
- match '/versions/newest' => 'static#newest_version', :as => "newest_version"
- scope :module => "Api" do
- resources :rels, :only => [:index, :show]
- resources :programs
- end
- end
-
- resources :programs, :only => [:index, :show]
-
- devise_for :users
- devise_scope :user do
- get "login" => "devise/sessions#new", :as => "login"
- get "logout" => "devise/sessions#destroy", :as => "logout"
- end
-
- resources :users, :constraints => { :id => /.*/ }, :only => :show do
- get "following" => "users#following", :as => :following
- get "followers" => "users#followers", :as => :followers
- post "follow" => "users#follow", :as => :follow
- post "unfollow" => "users#unfollow", :as => :unfollow
-
- resources :programs
- end
-
- # match ':user_id/:slug', :to => "programs#show", :as => :program
-
- match 'faq' => 'static#faq'
- match 'contribute' => 'static#contribute'
- root :to => "static#root"
-
-end
diff --git a/controllers/.content_controller.rb.swp b/controllers/.content_controller.rb.swp
new file mode 100644
index 00000000..d90b42c7
Binary files /dev/null and b/controllers/.content_controller.rb.swp differ
diff --git a/controllers/content_controller.html b/controllers/content_controller.html
new file mode 100644
index 00000000..aaddf303
--- /dev/null
+++ b/controllers/content_controller.html
@@ -0,0 +1,102 @@
+
+
+
+
+ content_controller.rb
+
+
+
+
unlesscurrent_user.following?@hacker
+ flash[:notice]="You're already not following #{params[:name]}."
+ redirect"/hackers/#{current_user.username}"
+ return
+ end
We’re also going to let people write programs in the browser, just in case
+ they’d like to share something, but the upload doesn’t work, or they want to
+ copy on part of their program, or anything else.
One of the best features of GitHub is the Explore page
+ . It shows off some neat repositories that people have made. So let’s do
+ that, as well. We want to show both the last 10 programs that have been
+ updated, as well as some featured programs.
We need to let people upload programs, so here it is! We want to allow API
+ access for this particular route, since we’ll be uploading programs from the
+ desktop application as well.
JSON is a really great way to share information that’s intended to be
+ consumed by someone else. This shows all of the programs a particular user
+ has made.
session[:hacker_id]=@hacker.id
+
+ flash[:notice]="Account created."
+ redirect'/'
+ else
+
+ flash[:notice]='There were some problems creating your account. Please be sure you\'ve entered all your information correctly.'
+
+ redirect'/download'
+ end
+end
This method will let people sign up from within the app. Frankly this is
+ a really bad way to do it, but I’m not sure what the best way is. It should
+ be combined with the signup method above. The issue is that signup via the
+ API should really just throw the message rather than redirect, but the site
+ should redirect. This probably should be managed via content negotiation. I’m
+ doing it the dirty way now, and when I look at exposing a Real Api I’ll worry
+ about making it 100% nice.
+
diff --git a/db/schema.rb b/db/schema.rb
deleted file mode 100644
index b5e6a796..00000000
--- a/db/schema.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# encoding: UTF-8
-# This file is auto-generated from the current state of the database. Instead
-# of editing this file, please use the migrations feature of Active Record to
-# incrementally modify your database, and then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your
-# database schema. If you need to create the application database on another
-# system, you should be using db:schema:load, not running all the migrations
-# from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 0) do
-
-end
diff --git a/db/seeds.rb b/db/seeds.rb
deleted file mode 100644
index 8c03291a..00000000
--- a/db/seeds.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-require 'faker'
-
-users = (0..5).to_a.collect do
- username = Faker::Internet.user_name
- user = User.create!(:username => username,
- :email => "#{username}@example.com",
- :password => (0...50).map{ ('a'..'z').to_a[rand(26)] }.join[0,12]
- )
- user
-end
-
-titles = [
-%Q{Variables?},
-%Q{What is Rails?},
-%Q{Shoes help!},
-%Q{Other programs?},
-%Q{Reading list question...}]
-
-questions = []
-questions << %Q{Hello! I have a question! How come I can do this:
- a = 5
-a = "hello"
-
-Shouldn't that not work? Why can a be five and then a String?
-}
-questions << %Q{What is 'ruby on rails?' I've seen stuff about it when I google for Ruby.
-}
-questions << %Q{I have a program that looks like this:
-
- edit_line
- button "Repeat" do
- alert("You said '#{??}'")
- end
-
-What do I do for the ??s?
-}
-questions << %Q{Does anyone have some programs to share?
-}
-questions << %Q{I've done all the Lessons! What should I check out next?
-}
-
-answers = []
-answers << [%Q{Ruby is really flexible, it doesn't care what kind of thing your variables are! Don't worry about it.}]
-answers << [%Q{It's a way to make websites with Ruby.}]
-answers << [%Q{Try this:
-
- line = edit_line
-
-and then
-
- alert("You said '\#{line.text}'")}, %Q{Hmm, I think you need a variable...}]
-answers << [%Q{Check out [the programs page](/programs).}]
-answers << [%Q{I like [_why's poignant guide to ruby](http://mislav.uniqpath.com/poignant-guide/).},
- %Q{Check out [Learn To Program](http://pine.fm/LearnToProgram/)!!!},
- %Q{There's a bunch of things [on Google](http://www.google.com/search?client=safari&rls=en&q=ruby+tutorial&ie=UTF-8&oe=UTF-8), explore them and try a bunch!},
- %Q{I love [Try Ruby](http://tryruby.org).}]
-
-5.times do |i|
- question = Question.new(
- :title => titles[i],
- :description => questions[i]
- )
- question.user = users[i]
- question.save!
- answers[i].collect! do |answer|
- answer = Answer.new(:description => answer)
- answer.question = question
- answer.user = users[(i + 1) % 5]
- answer.save
- answer
- end
- question.solution_id = answers[i].first.id
- question.save!
- questions[i] = question
-end
-
-program_code = "
-Turtle.draw do
- background maroon
- pencolor honeydew
- 450.times do
- forward 100
- turnright 70
- end
-end
-"
-
-5.times do |i|
- program = Program.new(:author_username => users[i].username,
- :title => Faker::Lorem.sentence,
- :description => Faker::Lorem.sentences.join(" "),
- :source_code => program_code)
- program.save!
-end
-
diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP
deleted file mode 100644
index fe41f5cc..00000000
--- a/doc/README_FOR_APP
+++ /dev/null
@@ -1,2 +0,0 @@
-Use this README file to introduce your application and point to useful places in the API for learning more.
-Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
diff --git a/features/answers.feature b/features/answers.feature
deleted file mode 100644
index d647cebe..00000000
--- a/features/answers.feature
+++ /dev/null
@@ -1,18 +0,0 @@
-Feature: CRUD actions for answers
-
- As a user of the site, I can perform standard CRUD actions on answers
-
- Scenario: Create an answer
- And a question exists
- And I answer that question
- Then I should be notified that my answer was submitted
- And an email should be sent to the author
- And I should be able to see my answer
- And my answer should show on my profile page
-
- Scenario: Edit an answer
- And a question exists
- And I answer that question
- When I edit that answer
- Then I should see the updated answer
-
diff --git a/features/blog.feature b/features/blog.feature
deleted file mode 100644
index 4c538602..00000000
--- a/features/blog.feature
+++ /dev/null
@@ -1,22 +0,0 @@
-Feature: Hackety Blog
-
- As an admin, I can post to the hackety blog.
-
- Scenario: Read the blog
- Given a blog post exists
- When I visit the blog
- Then I should see the title of that post
- And I should see the content of that post
-
- Scenario: Read a post
- Given a blog post exists
- When I visit a blog post
- Then I should see the title of that post
- And I should see the content of that post
-
- Scenario: Post to the blog
- Given I'm logged in as someone who can post to the blog
- When I visit the blog admin page
- And I fill out the new blog form
- And I press "Create Blog post"
- Then I should see that my post has been created
diff --git a/features/lessons.feature b/features/lessons.feature
deleted file mode 100644
index 0f3b92ad..00000000
--- a/features/lessons.feature
+++ /dev/null
@@ -1,13 +0,0 @@
-Feature: Hackety Lessons
-
- As a user of the site, I can visit lessons page
-
- Scenario: View the lessons
- When I visit lessons path
- Then I should see the list of lessons
-
- Scenario: View specific lesson
- When I visit lessons path
- When I click on lesson's title
- Then I should see lesson content
-
diff --git a/features/moderator.feature b/features/moderator.feature
deleted file mode 100644
index 2071f212..00000000
--- a/features/moderator.feature
+++ /dev/null
@@ -1,15 +0,0 @@
-Feature: Moderate questions
-
- As a moderator, I should be able to delete questions from the site.
-
- Background:
- Given there is a question from someone else
-
- Scenario: Delete a question
- Given I am a moderator
- Then I can delete that question
-
- Scenario: Normal users cannot moderate
- Given I am not a moderator
- Then I cannot delete that question
-
diff --git a/features/programs.feature b/features/programs.feature
deleted file mode 100644
index f2ead8ec..00000000
--- a/features/programs.feature
+++ /dev/null
@@ -1,29 +0,0 @@
-Feature: Access Programs
-
- As a user of the site, I want to access users' programs
-
- Scenario: View a featured program
- Given there is a featured program
- Then I should be able to view a highlighted program
-
- Scenario: View my programs
- Given a logged in user
- And I have uploaded a program
- Then I should be able to view my programs
-
- Scenario: View another user's programs
- Given a user has uploaded a program
- Then I should be able to view their programs
-
- Scenario: View an individual program
- Given a user has uploaded a program
- And I should be able to view their programs
- When I click the first program link
- Then I should see the program source
-
- Scenario: View a program with a description
- Given a user has uploaded a program
- And they have given their program a description
- And I should be able to view their programs
- When I click the first program link
- Then I should see the description of their program
diff --git a/features/questions.feature b/features/questions.feature
deleted file mode 100644
index ac233e90..00000000
--- a/features/questions.feature
+++ /dev/null
@@ -1,15 +0,0 @@
-Feature: CRUD actions for question
-
- As a user of the site, I can perform standard CRUD actions on questions
-
- Scenario: Create a question
- When I create a new question
- Then I should be told the question was created
- And I should be able to see the new question
- And I should be able to see the question on my profile page
-
- Scenario: Update a question
- Given I am a user that has created a question
- When I edit that question
- Then I should be told the question was updated
- And I should see that the question was updated
diff --git a/features/questions_pagination.feature b/features/questions_pagination.feature
deleted file mode 100644
index 3b0f35d6..00000000
--- a/features/questions_pagination.feature
+++ /dev/null
@@ -1,13 +0,0 @@
-Feature: Pagination for different types of questions
-
- As a user of the site, I can view pages of different types of questions
-
- Scenario: View support questions
- Given support questions exist
- When I visit the support questions page
- Then I should see a link to the next page of support questions
-
- Scenario: View non-support questions
- Given questions exist
- When I visit the questions page
- Then I should see a link to the next page of questions
diff --git a/features/signup.feature b/features/signup.feature
deleted file mode 100644
index 442dd0bd..00000000
--- a/features/signup.feature
+++ /dev/null
@@ -1,11 +0,0 @@
-Feature: Sign up for an account
-
- As a new Hackety user, I want to create a new account and log in with it
-
- Scenario: Create an account via the signup form
- When I register a new account
- Then I should be logged in with my new account
-
- Scenario: Try to sign up using existing user name
- When I register a duplicate account
- Then I should see validation errors
diff --git a/features/statics.feature b/features/statics.feature
deleted file mode 100644
index 37294c25..00000000
--- a/features/statics.feature
+++ /dev/null
@@ -1,19 +0,0 @@
-Feature: Detect user's platform and provide download link
-
- As a fresh Hackety user, I want to download software for my current OS
-
- Scenario: MacOS User
- Given "Mac" user agent
- Then I should be able to download "mac" software
-
- Scenario: Windows User
- Given "Windows" user agent
- Then I should be able to download "windows" software
-
- Scenario: Linux User
- Given "Linux" user agent
- Then I should be able to download "linux" software
-
- Scenario: Android User
- Given "android" user agent
- Then I should be able to download "android" software
diff --git a/features/step_definitions/answer_steps.rb b/features/step_definitions/answer_steps.rb
deleted file mode 100644
index 515e2099..00000000
--- a/features/step_definitions/answer_steps.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-Given /^a question exists$/ do
- login_user
- create_question_for(@user)
-end
-
-Given /^I answer that question$/ do
- visit new_question_answer_path(@question)
- fill_in "Answer", with: "Have you tried turning it off and on again?"
- click_button "Post Answer"
-end
-
-Then /^I should be notified that my answer was submitted$/ do
- page.should have_content("Answer Posted")
-end
-
-Then /^I should be able to see my answer$/ do
- page.should have_content("#{@user.username} says")
- page.should have_content("Have you tried turning it off and on again?")
-end
-
-Then /^my answer should show on my profile page$/ do
- visit user_path(@user)
- page.should have_content(@question.title)
- page.should have_content("Have you tried turning it off and on again?")
-end
-
-Then /^an email should be sent to the author$/ do
- ActionMailer::Base.deliveries.should_not be_empty
-end
-
-When /^I edit that answer$/ do
- visit question_path(@question)
- page.find('.answer > .links').click_link('Edit')
- fill_in 'Answer', with: 'Edit: Did you try magic?'
- click_button 'Post Answer'
-end
-
-Then /^I should see the updated answer$/ do
- page.should have_content("#{@user.username} says")
- page.should have_content('Edit: Did you try magic?')
-end
-
diff --git a/features/step_definitions/blog_steps.rb b/features/step_definitions/blog_steps.rb
deleted file mode 100644
index a200644e..00000000
--- a/features/step_definitions/blog_steps.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-Given /^a blog post exists$/ do
- @post = Fabricate(:blog_post)
-end
-
-When /^I visit the blog$/ do
- visit "/blog"
-end
-
-Then /^I should see the content of that post$/ do
- page.should have_content(@post.content)
-end
-
-Then /^I should see the title of that post$/ do
- page.should have_content(@post.title)
-end
-
-Given /^I'm logged in as someone who can post to the blog$/ do
- step %{a logged in user}
- @user.blog_poster = true
- @user.save
-end
-
-When /^I visit the blog admin page$/ do
- visit "/blog/admin"
-end
-
-When /^I fill out the new blog form$/ do
- #this is silly
- @post = OpenStruct.new
- @post.title = "A title"
-
- fill_in :blog_post_title, :with => "A title"
- fill_in :blog_post_content, :with => "Some content"
-end
-
-When /^I press "([^"]*)"$/ do |name|
- click_button name
-end
-
-Then /^I should see that my post has been created$/ do
- page.should have_content("Post created!")
-end
-
-When /^I visit a blog post$/ do
- visit blog_path(@post)
-end
-
diff --git a/features/step_definitions/lesson_steps.rb b/features/step_definitions/lesson_steps.rb
deleted file mode 100644
index d7355def..00000000
--- a/features/step_definitions/lesson_steps.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-When(/^I visit lessons path$/) do
- visit lessons_path
-end
-
-Then(/^I should see the list of lessons$/) do
- page.should have_content("Lessons")
- page.should have_content("A Tour of Hackety Hack")
-end
-
-When(/^I click on lesson's title$/) do
- click_link("A Tour of Hackety Hack")
-end
-
-Then(/^I should see lesson content$/) do
- expect(page).to have_title "A Tour of Hackety Hack"
- page.should have_content("Welcome to the Hackety Hack tour!")
-end
diff --git a/features/step_definitions/program_steps.rb b/features/step_definitions/program_steps.rb
deleted file mode 100644
index 619e275c..00000000
--- a/features/step_definitions/program_steps.rb
+++ /dev/null
@@ -1,71 +0,0 @@
- Given /^there is a featured program$/ do
- @program = Program.create!(:author_username => "username",
- :slug => "slug",
- :title => "My Featured Program",
- :featured => true)
-end
-
-Then /^I should be able to view a highlighted program$/ do
- visit programs_path
- within "#featured" do
- page.should have_content("My Featured Program")
- end
-end
-
-def upload_program(user)
- @program = Program.create!(:author_username => user.username,
- :slug => "slug",
- :title => "#{user.username}'s program",
- :source_code => "puts 'Hello world'")
-end
-
-Given /^I have uploaded a program$/ do
- upload_program(@user)
-end
-
-Given /^a user has uploaded a program$/ do
- @user = User.create!(:username => "some_user",
- :password => "password",
- :password_confirmation => "password",
- :email => "some_user@example.com")
- upload_program(@user)
-end
-
-Given /^they have given their program a description$/ do
- @program = Program.last
- @program.description = "A really cool program!"
- @program.save
-end
-
-
-def visit_user_programs_page
- visit user_path(@user)
- within ".about-user" do
- find(".user-programs").click()
- end
- page.should have_content(@program.title.titleize)
-end
-
-Then /^I should be able to view my programs$/ do
- visit_user_programs_page
-end
-
-Then /^I should be able to view their programs$/ do
- visit_user_programs_page
-end
-
-When /^I click the first program link$/ do
- within "#all-programs ul" do
- first("li:first-child a").click()
- end
-end
-
-Then /^I should see the program source$/ do
- within("#program") do
- page.should have_content("puts 'Hello world'")
- end
-end
-
-Then /^I should see the description of their program$/ do
- page.should have_content("A really cool program!")
-end
diff --git a/features/step_definitions/question_steps.rb b/features/step_definitions/question_steps.rb
deleted file mode 100644
index 385d208e..00000000
--- a/features/step_definitions/question_steps.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-def create_question_for(user)
- @question = Question.new(:title => "A question",
- :description => "The description")
- @question.user = user
- @question.save
-end
-
-When /^I create a new question$/ do
- step %{a logged in user}
- visit new_question_path
- fill_in("Title", with: "My Question")
- fill_in("Description", with: "My Description")
- click_button "Ask Everyone"
-end
-
-Then /^I should be told the question was created$/ do
- page.should have_content("Question Asked")
-end
-
-Then /^I should be able to see the new question$/ do
- click_link("My Question")
- page.should have_content("My Question")
- page.should have_content("My Description")
-end
-
-Given /^I am a user that has created a question$/ do
- step %{a logged in user}
- create_question_for(@user)
-end
-
-When /^I edit that question$/ do
- visit edit_question_path(@question)
- fill_in "Title", with: "An edited question"
- fill_in "Description", with: "Just a quick edit"
- click_button "Ask Everyone"
-end
-
-Then /^I should be told the question was updated$/ do
- page.should have_content("successfully updated")
-end
-
-Then /^I should see that the question was updated$/ do
- page.should have_content('An edited question')
- page.should have_content('Just a quick edit')
-end
-
-Then /^I should be able to see the question on my profile page$/ do
- visit user_path(@user)
- page.should have_content("My Question")
-end
-
-Given /^I am a moderator$/ do
- step %{a logged in user}
- @user.moderator = true
- @user.save
-end
-
-Given /^I am not a moderator$/ do
- step %{a logged in user}
- @user.moderator = false
- @user.save
-end
-
-Given /^there is a question from someone else$/ do
- @question = Question.create(:title => "A question to delete",
- :description => "moderator should delete me!",
- :user => Fabricate(:user))
-end
-
-Then /^I can delete that question$/ do
- visit question_path(@question)
- page.should have_content('Delete')
-end
-
-Then /^I cannot delete that question$/ do
- visit question_path(@question)
- page.should_not have_content('Delete')
-end
-
-Given /^(\w*)\s?questions exist$/ do |type|
- 30.times do
- Question.create(title: 'Test', description: 'Test',
- support: type == 'support' ? true : false)
- end
-end
-
-When /^I visit the (\w*)\s?questions page$/ do |type|
- visit(type == 'support' ? support_questions_path : questions_path)
-end
-
-Then /^I should see a link to the next page of (\w*)\s?questions$/ do |type|
- href = type == 'support' ? '/support/questions?page=2' : '/questions?page=2'
- page.should have_link '2', href: href
-end
diff --git a/features/step_definitions/signup_steps.rb b/features/step_definitions/signup_steps.rb
deleted file mode 100644
index 9d1cdb15..00000000
--- a/features/step_definitions/signup_steps.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-def register_user(user)
- visit new_user_registration_path
- fill_in("Username", :with => user[:username])
- fill_in("Email", :with => user[:email])
- fill_in("Password", :with => user[:password])
- fill_in("Password confirmation", :with => user[:password])
-
- click_button "Sign up"
-end
-
-When /^I register a new account$/ do
- @new_user = {:username => "username", :password => "password", :email => "test@example.com"}
- register_user @new_user
-end
-
-When /^I register a duplicate account$/ do
- @existing_user = User.create!(username: "existing_user",
- email: "existing_user@example.com",
- password: "foobar",
- password_confirmation: "foobar")
- register_user @existing_user
-end
-
-When /^I should be logged in with my new account$/ do
- page.should have_content("You have signed up successfully")
- page.should have_content(@new_user[:username])
-end
-
-Then /^I should see validation errors$/ do
- page.should have_selector(".error_notification")
-end
diff --git a/features/step_definitions/static_steps.rb b/features/step_definitions/static_steps.rb
deleted file mode 100644
index b09a519a..00000000
--- a/features/step_definitions/static_steps.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-Given(/^"(.*?)" user agent$/) do |agent|
- page.driver.header('User-Agent', agent)
-end
-
-Then(/^I should be able to download "(.*?)" software$/) do |system|
- visit download_path
- page.should have_content("Version 1.0.1 for #{system}")
-end
\ No newline at end of file
diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb
deleted file mode 100644
index dafb78b1..00000000
--- a/features/step_definitions/user_steps.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-def login_user
- @user = User.create!(username: "test_user",
- email: "test_user@example.com",
- password: "foobar",
- password_confirmation: "foobar")
- visit login_path
- fill_in("Username", :with => @user.username)
- fill_in("Password", :with => @user.password)
- click_button("Sign in")
-end
-
-def create_other_user
- @other_user = User.create!(username: "other_user",
- email: "other_user@example.com",
- password: "123456",
- password_confirmation: "123456")
-end
-
-Given /^a logged in user$/ do
- login_user unless @user
-end
-
-Given /^a steve exists$/ do
- @steve = User.create!(username: "steve",
- email: "steve_user@example.com",
- password: "foobar",
- password_confirmation: "foobar")
-end
-
-When /^I go to look at my profile page$/ do
- visit user_path(@user)
-end
-
-Then /^it should have the right information$/ do
- page.should have_title("#{@user.username}'s Profile\n | Hackety Hack!")
- page.should have_content("#{@user.username}'s Profile")
-end
-
-When /^I edit my profile$/ do
- visit('/users/edit')
- fill_in("About", with: "Test user likes to edit his profile|")
- fill_in("Current password", with: @user.password)
- click_button "Update"
-end
-
-When /^I have a follower$/ do
- create_other_user
- @other_user.follow! @user
-end
-
-When /^I am following someone$/ do
- create_other_user
- @user.follow! @other_user
-end
-
-When /^I click on the number of followers on my profile$/ do
- step 'I go to look at my profile page'
- first('.user-followers').click
-end
-
-When /^I click on the number of people I am following on my profile$/ do
- step 'I go to look at my profile page'
- first('.user-following').click
-end
-
-Then /^I should see someone I'm following$/ do
- page.should have_link @other_user.username
-end
-
-Then /^I should see my follower$/ do
- page.should have_link @other_user.username
-end
-
-Then /^I should be notified that my profile was updated$/ do
- page.should have_content("updated your account")
-end
-
-Then /^I should see my changes reflected on my profile page$/ do
- visit("/users/#{@user.username}")
- page.should have_content("Test user likes to edit his profile")
-end
-
-Then(/^I should see 'Steve'$/) do
- @user.following?(@steve).should == true
- page.should have_link @steve.username
-end
diff --git a/features/support/env.rb b/features/support/env.rb
deleted file mode 100644
index 25e027c5..00000000
--- a/features/support/env.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
-# It is recommended to regenerate this file in the future when you upgrade to a
-# newer version of cucumber-rails. Consider adding your own code to a new file
-# instead of editing this one. Cucumber will automatically load all features/**/*.rb
-# files.
-#
-
-require_relative '../../spec/code_coverage'
-
-require 'cucumber/rails'
-require 'ruby-debug'
-
-# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
-# order to ease the transition to Capybara we set the default here. If you'd
-# prefer to use XPath just remove this line and adjust any selectors in your
-# steps to use the XPath syntax.
-Capybara.default_selector = :css
-
-# By default, any exception happening in your Rails application will bubble up
-# to Cucumber so that your scenario will fail. This is a different from how
-# your application behaves in the production environment, where an error page will
-# be rendered instead.
-#
-# Sometimes we want to override this default behaviour and allow Rails to rescue
-# exceptions and display an error page (just like when the app is running in production).
-# Typical scenarios where you want to do this is when you test your error pages.
-# There are two ways to allow Rails to rescue exceptions:
-#
-# 1) Tag your scenario (or feature) with @allow-rescue
-#
-# 2) Set the value below to true. Beware that doing this globally is not
-# recommended as it will mask a lot of errors for you!
-#
-ActionController::Base.allow_rescue = false
-
-# Remove/comment out the lines below if your app doesn't have a database.
-# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
-DatabaseCleaner.orm = "mongo_mapper"
-DatabaseCleaner[:mongo_mapper].strategy = :truncation
-
-Before do
- DatabaseCleaner[:mongo_mapper].clean
-end
-
-# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
-# See the DatabaseCleaner documentation for details. Example:
-#
-# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
-# DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
-# end
-#
-# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
-# DatabaseCleaner.strategy = :transaction
-# end
-#
diff --git a/features/support/mailer.rb b/features/support/mailer.rb
deleted file mode 100644
index 8cdfb2f1..00000000
--- a/features/support/mailer.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-Before do
- ActionMailer::Base.deliveries.clear
-end
diff --git a/features/users.feature b/features/users.feature
deleted file mode 100644
index 2d67ae5d..00000000
--- a/features/users.feature
+++ /dev/null
@@ -1,30 +0,0 @@
-Feature: Manage account
-
- As a user of this site, I can view and update my profile, see my followers
-
- Background:
- Given a steve exists
- And a logged in user
-
- Scenario: View my profile
- When I go to look at my profile page
- Then it should have the right information
-
- Scenario: Edit my profile
- When I edit my profile
- Then I should be notified that my profile was updated
- And I should see my changes reflected on my profile page
-
- Scenario: See my followers
- When I have a follower
- And I click on the number of followers on my profile
- Then I should see my follower
-
- Scenario: See who I am following
- When I am following someone
- And I click on the number of people I am following on my profile
- Then I should see someone I'm following
-
- Scenario: I should always follow steve and vice versa
- When I click on the number of people I am following on my profile
- Then I should see 'Steve'
diff --git a/hackety.html b/hackety.html
new file mode 100644
index 00000000..9eed1d84
--- /dev/null
+++ b/hackety.html
@@ -0,0 +1,448 @@
+
+
+
+
+ hackety.rb
+
+
+
+
This is the source code for the Hackety Hack website. Hackety Hack is
+ the easiest way to learn programming, and so our documentation should be
+ top-notch.
+
+
To get started, you’ll need to install some prerequisite software:
+
+
Ruby is used to power the site. We’re currently using ruby 1.9.2p0. I
+ highly reccomend that you use rvm to install and manage your Rubies.
+ It’s a fantastic tool. If you do decide to use rvm, you can install the
+ appropriate Ruby and create a gemset by simply cd-ing into the root project
+ directory; I have a magical .rvmrc file that’ll set you up.
+
+
MongoDB is a really awesome document store. We use it to persist all of
+ the data on the website. To get MongoDB, please visit their
+ downloads page to find a package for your
+ system.
+
+
After installing Ruby and MongoDB, you need to aquire all of the Ruby gems
+ that we use. This is pretty easy, since we’re using bundler. Just do
+ this:
+
+
$ gem install bundler
+ $ bundle install
+
+
+
That’ll set it all up! Then, you need to make sure you’re running MongoDB.
+ I have to open up another tab in my terminal and type
+
+
$ mongod
+
+
+
to get this to happen. When you’re done hacking, you can hit ^-c to stop
+ mongod from running.
We need a secret for our sessions. This is set via an environment variable so
+ that we don’t have to give it away in the source code. Heroku makes it really
+ easy to keep environment variables set up, so this ends up being pretty nice.
+ This also has to be included before rack-flash, or it blows up.
Rails has a content_for helper that lets you place different parts of your
+ view into different places in your template. This helps a lot with
+ javascript, and conditional stylesheets or other includes. It’s so nice that
+ foca has written
+ a Sinatra version.
We use Exceptional to keep track of errors
+ that happen. This code is from their
+ example documentation
+ for Sinatra. It might be better off inside of a config block, but I haven’t
+ tested it in that role yet.
The PONY_VIA_OPTIONS hash is used to configure pony. Basically, we only
+ want to actually send mail if we’re in the production environment. So we set
+ the hash to just be {}, except when we want to send mail.
We’re using SendGrid to send our emails. It’s really
+ easy; the Heroku addon sets us up with environment variables with all of the
+ configuration options that we need.
We don’t want to bother with running our own MongoDB server in production;
+ that’s what The Cloud ™ is for! So we want to double check our environment
+ variables, and if it appears that we’d like to connect to
+ MongoHQ, let’s do that. Otherwise, just connect to
+ our local server running on localhost.
Since Sinatra doesn’t automatically load anything, we have to do it
+ ourselves. Remember that helpers.rb file? Well, we made a handy
+ require_directory method that, well, requires a whole directory. So let’s
+ include both of our models as well as our controllers.
The first thing you’ll ever see when going to the website is here. It all
+ starts with /. If we’re logged in, we want to just redirect to the main
+ activity stream. If not, let’s show that pretty splash page that sings all of
+ our praises.
+
+
One small note about rendering, though: Our main layout doesn’t exactly work
+ for the main page, it’s an exception. So we don’t want to use our regular old
+ layout.haml file. So we tell Sinatra not to.
+
+
+
get'/'do
+ iflogged_in?
+ redirect"/stream"
+ end
+ haml:index,:layout=>:plain
+end
Hopefully, anyone visiting the site will think that Hackety Hack sounds
+ pretty cool. If they do, they’ll visit the downloads page. This’ll direct
+ them to download Hackety, and sign up for an account.
+
+
Similar to the home page, we also don’t want our layout here, either.
The main activity stream is the main page for the site when a user is logged
+ in. It lets them share what they’re doing with others, and also view all of
+ the content that others have posted. So we grab it all, and sort it in the
+ opposite order that it’s been updated. Wouldn’t want to see old stuff!
The helpers.rb file contains all of our Sinatra helpers. This is large
+ enough that including it in a separate file makes it much easier to find;
+ otherwise, I’d be opening hackety.rb and searching for ‘helpers,’ and
+ that’s just stupid.
A tiny bit of metaprogramming goes a long way. We want to generate three
+ methods (development?, production?, and test?) that let us know which
+ environment we happen to be in. This is useful in a few places.
+
+
+
[:development,:production,:test].eachdo|environment|
+ define_method"#{environment.to_s}?"do
+ returnsettings.environment==environment.to_sym
+ end
+ end
This incredibly useful helper gives us the currently logged in user. We
+ keep track of that by just setting a session variable with their id. If it
+ doesn’t exist, we just want to return nil.
+
+
+
defcurrent_user
+ returnHacker.first(:id=>session[:hacker_id])ifsession[:hacker_id]
+ nil
+ end
Our admin_only! helper will only let admin users visit the page. If
+ they’re not an admin, we redirect them to either / or the page that we
+ specified when we called it.
+
+
+
defadmin_only!(opts={:return=>"/"})
+ unlesslogged_in?&¤t_user.admin?
+ flash[:error]="Sorry, buddy"
+ redirectopts[:return]
+ end
+ end
We also want to have a way for the desktop application to make calls to the
+ site. For this, we allow a username and password to be passed in, and we
+ authenticate directly, rather than relying on a previously logged in
+ session.
+
+
+
defrequire_login_or_api!(opts={})
+ returnifsession[:hacker_id]
+ hacker=Hacker.authenticate(opts[:username],opts[:password])
+ ifhacker
+ session[:hacker_id]=hacker.id
+ else
+ halt401
+ end
+ end
Gravatar is used for our avatars. Generating the
+ url for one is pretty simple, we just need the proper email address, and
+ then we make an md5 of it. No biggie.
+
+
+
defgravatar_url_foremail
+ require'digest/md5'
+ "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.downcase)}"
+ end
+
+end
Comments are an embedded document that’s inside of a few different things:
+ content, programs, and maybe other stuff in the future. They’re really
+ simple: Just some text, the person who said it, and their email address. The
+ author should be the slug. Having the email lets us show their avatar easily.
This method sets our password. The first thign we need to get a ‘salt’. You
+ can read about salts here.
+ basically, we combine the password with the salt, and then encrypt it, and
+ store that in the database.
+
+
The reason that we do this is because we don’t want to keep someone’s
+ password in the database, because you never want to write those down!
+ So when we go to look up a password, we can do the same procedure.
then, we do the same thing that we did when we stored the hashed password:
+ encrypt the password using the salt, and compare it to the one we saved
+ if they’re the same, we know they entered the right password.
Sending emails is a good thing. We wouldn’t want you to not realize you
+ have a message! Right now, we explicitly test for development mode, because
+ of some weirdness. I’d much rather remove that unless, but I haven’t
+ gotten around to figuring it out yet.
+
+
+
+
defsend_notification
+ unlessdevelopment?
+ recipient_email=Hacker.first(:username=>self.recipient).email
+ Notifier.send_message_notification(recipient_email,self.sender)
+ end
+ end
+
+end
This class handles sending emails. Everything related to it should go in
+ here, that way it’s just as easy as
+ Notifier.send_message_notification(me, you) to send a message.
The Program class represents a program that someone’s uploaded. Right now
+ we only store the latest version as text, but eventually, I’d love for
+ programs to be backed by git.
We've been notified about this issue and we'll take a look at it shortly.
-
-
-
-
-
-
-
diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index e69de29b..00000000
diff --git a/public/robots.txt b/public/robots.txt
deleted file mode 100644
index 085187fa..00000000
--- a/public/robots.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
-#
-# To ban all spiders from the entire site uncomment the next two lines:
-# User-Agent: *
-# Disallow: /
diff --git a/script/bootstrap b/script/bootstrap
deleted file mode 100755
index de77ea4d..00000000
--- a/script/bootstrap
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-
-go_go_gadget_bootstrap() {
- check_ruby
- check_mongo
- check_bundler
- bail_unless_chill
- good_luck_have_fun
-}
-
-check_mongo() {
- which mongo > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- NOMONGO="Hey, in order to remember stuff I need MongoDB"
- fi
-}
-
-check_bundler() {
- if [ -z "$NORUBY" ]; then
- which bundle > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- gem install bundler || exit 2
- fi
- fi
-}
-
-good_luck_have_fun() {
- bundle install
- rake spec cucumber
-}
-
-check_ruby() {
- which ruby > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- NORUBY="Whoa there, looks like you're missing Ruby!"
- else
- ruby -v | grep '^ruby 1.9.3' > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- NORUBY="Hrmm, your Ruby version isn't Ruby 1.9.3, that's really what I prefer."
- fi
- fi
-}
-
-bail_unless_chill() {
- if [ "$NORUBY" -a "$NOMONGO" ]; then
- echo "$NORUBY"
- echo "$NOMONGO"
- exit 1
- elif [ "$NORUBY" ]; then
- echo "$NORUBY"
- exit 1
- elif [ "$NOMONGO" ]; then
- echo "$NOMONGO"
- exit 1
- fi
-}
-
-go_go_gadget_bootstrap
diff --git a/script/cucumber b/script/cucumber
deleted file mode 100755
index 7fa5c920..00000000
--- a/script/cucumber
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-
-vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
-if vendored_cucumber_bin
- load File.expand_path(vendored_cucumber_bin)
-else
- require 'rubygems' unless ENV['NO_RUBYGEMS']
- require 'cucumber'
- load Cucumber::BINARY
-end
diff --git a/script/rails b/script/rails
deleted file mode 100755
index f8da2cff..00000000
--- a/script/rails
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env ruby
-# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
-
-APP_PATH = File.expand_path('../../config/application', __FILE__)
-require File.expand_path('../../config/boot', __FILE__)
-require 'rails/commands'
diff --git a/spec/code_coverage.rb b/spec/code_coverage.rb
deleted file mode 100644
index 605db4e3..00000000
--- a/spec/code_coverage.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'simplecov'
-require 'coveralls'
-
-SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
- Coveralls::SimpleCov::Formatter,
- SimpleCov::Formatter::HTMLFormatter
-]
-SimpleCov.start do
- add_filter '/config/'
- add_filter '/vendor/'
- add_filter '/spec/'
- add_filter '/features/'
-end
\ No newline at end of file
diff --git a/spec/controllers/blog_controller_spec.rb b/spec/controllers/blog_controller_spec.rb
deleted file mode 100644
index 8da8d9df..00000000
--- a/spec/controllers/blog_controller_spec.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-require 'spec_helper'
-
-describe BlogController do
- let(:blog_post) { Fabricate(:blog_post) }
- let(:another_blog_post) { Fabricate(:another_blog_post) }
-
- describe('#index') do
- it "gets index successfully" do
- get :index
- response.should be_successful
- end
-
- describe("handles posts by") do
- before(:each) do
- blog_post
- another_blog_post
- get :index
- @posts = assigns(:posts)
- end
- it "fetching posts" do
- @posts.size.should == 2
- end
- it "sorting them in reverse order" do
- @posts.first.content[0].should > @posts.last.content[0]
- end
- end
- end
-
- describe "#show" do
- before(:each) do
- blog_post
- get :show, id: blog_post
- end
- it { response.should be_successful }
- it { assigns(:post).should == blog_post }
- end
-
- describe "#admin" do
- context "when user is not signed in" do
- before(:each) do
- get :create
- end
- #TODO Should it not use signin_path?
- it { response.should redirect_to(new_user_session_path) }
- end
-
- context "when user is not an blog_poster" do
- before(:each) do
- blog_post
- get :admin
- end
- it { response.should be_redirect }
- it { assigns(:post).should be_nil }
- it { assigns(:posts).should be_nil }
- end
- context "when user is a blog_poster" do
- before(:each) do
- sign_in Fabricate(:user, blog_poster: true)
- blog_post
- get :admin
- end
- it { response.should be_successful }
- it { assigns(:post).should be_a_new(BlogPost) }
- it { assigns(:posts).size.should == 1 }
- end
- end
-
- describe "#create" do
- context "when user is not signed in" do
- before(:each) do
- get :create
- end
- #TODO Should it not use signin_path?
- it { response.should redirect_to(new_user_session_path) }
- end
-
- context "when user is not an blog_poster" do
- before(:each) do
- sign_in Fabricate(:user)
- get :create
- end
-
- it { response.should redirect_to(blog_index_path) }
-
- it { assigns(:post).should be_nil }
- end
-
- context "when user is a blog_poster" do
- before(:each) do
- sign_in Fabricate(:user, blog_poster: true)
- end
-
- it "redirects to admin_blog_index_path when user is blog_poster" do
- post :create
- response.should redirect_to(admin_blog_index_path)
- end
-
- it "creates a new blogpost" do
- ->{ post :create, blog_post: Fabricate.build(:blog_post).attributes }
- .should change(BlogPost, :count).by(1)
- end
- end
- end
-end
diff --git a/spec/controllers/mailer_controller_spec.rb b/spec/controllers/mailer_controller_spec.rb
deleted file mode 100644
index 2c5f7554..00000000
--- a/spec/controllers/mailer_controller_spec.rb
+++ /dev/null
@@ -1,137 +0,0 @@
-require 'spec_helper'
-
-describe MailerController do
- let(:user) { Fabricate(:user) }
- let(:users) { Fabricate.sequence(:user, 5)}
- let(:diffusion) { Fabricate.build(:diffusion) }
-
- shared_examples 'unauthorized' do
- it 'redirects to the login page' do
- response.should redirect_to(login_path)
- end
- end
-
- describe "GET 'new' for a single user email" do
-
- context 'when user is a moderator' do
- before { sign_in Fabricate(:user, moderator: true) }
- it "returns http success" do
- get :new, user: Array(user)
- response.should be_success
- end
- end
-
- context 'when user is not a moderator' do
- before do
- sign_in Fabricate(:user)
- get :new, user: Array(user)
- end
- it_behaves_like 'unauthorized'
- end
-
- context 'when user is a guest' do
- before { get :new, user: Array(user) }
- it_behaves_like 'unauthorized'
- end
- end
-
- describe "GET 'new' for a diffusion" do
- context 'when user is a moderator' do
- before { sign_in Fabricate(:user, moderator: true) }
- it "returns http success" do
- get :new, user: Array(users)
- response.should be_success
- end
- end
-
- context 'when user is not a moderator' do
- before do
- sign_in Fabricate(:user)
- get :new, user: Array(users)
- end
- it_behaves_like 'unauthorized'
- end
-
- context 'when user is a guest' do
- before { get :new, user: Array(users) }
- it_behaves_like 'unauthorized'
- end
- end
-
- describe "POST 'create' for a single user email" do
- before :each do
- @message = Fabricate.build(:message)
- end
-
- context 'when user is a moderator' do
- before { sign_in Fabricate(:user, moderator: true) }
- it 'delivers the email' do
- expect {
- post :create, message: @message
- }.to change {ActionMailer::Base.deliveries.size}.by(1)
- end
-
- describe 'delivered message' do
- before :each do
- post :create, message: @message
- end
-
- it "returns http success" do
- response.should be_redirect
- end
-
- it 'delivers the mail with the subject that we wanted to' do
- ActionMailer::Base.deliveries.last.subject.should == @message.subject
- end
-
- it 'delivers the mail with the body that we wanted to' do
- ActionMailer::Base.deliveries.last.body.to_s.should match @message.body
- end
- end
-
- describe 'empty message' do
- it "returns exception" do
- post :create
- expect(subject).to render_template(:new)
- end
- end
- end
-
- context 'when user is not a moderator' do
- before do
- sign_in Fabricate(:user)
- post :create, message: @message
- end
- it_behaves_like 'unauthorized'
- end
-
- context 'when user is a guest' do
- before { post :create, message: @message }
- it_behaves_like 'unauthorized'
- end
- end
-
- describe "POST 'create' for a diffusion" do
- context 'when user is a moderator' do
- before { sign_in Fabricate(:user, moderator: true) }
- it "returns http success" do
- expect {
- post 'create', message: diffusion
- }.to change {ActionMailer::Base.deliveries.size}.by(diffusion.email.size)
- end
- end
-
- context 'when user is not a moderator' do
- before do
- sign_in Fabricate(:user)
- post :create, message: diffusion
- end
- it_behaves_like 'unauthorized'
- end
-
- context 'when user is a guest' do
- before { post :create, message: diffusion }
- it_behaves_like 'unauthorized'
- end
- end
-end
diff --git a/spec/controllers/questions_controller_spec.rb b/spec/controllers/questions_controller_spec.rb
deleted file mode 100644
index c6e15a89..00000000
--- a/spec/controllers/questions_controller_spec.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'spec_helper'
-
-describe QuestionsController do
- describe "GET index" do
- context "with format atom" do
- it "responds with success" do
- get :index, format: :atom
- response.should be_success
- end
- end
- end
-end
diff --git a/spec/controllers/rel_controller_spec.rb b/spec/controllers/rel_controller_spec.rb
deleted file mode 100644
index ac13dba5..00000000
--- a/spec/controllers/rel_controller_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'spec_helper'
-
-describe Api::RelsController do
- let(:slug){Fabricate(:rel)}
-
- describe "GET index" do
- it "responds with success" do
- get :index
- response.should be_success
- end
- end
-
- describe "GET show" do
- it "responds with success" do
- get :show
- response.should be_success
- end
- end
-end
\ No newline at end of file
diff --git a/spec/controllers/static_controller_spec.rb b/spec/controllers/static_controller_spec.rb
deleted file mode 100644
index ece397af..00000000
--- a/spec/controllers/static_controller_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'spec_helper'
-
-describe StaticController do
- describe "GET root" do
- it "responds with success" do
- expect(:get => "/").to route_to(:controller => "static", :action => "root")
- end
- end
-
- describe "GET api_root" do
- it "should render api layout" do
- get :api_root
- response.should render_template(:layout => "api")
- end
- end
-
- describe "GET newest_version" do
- it "should render version of api" do
- get :newest_version
- response.header['Content-Type'].should include 'application/json'
- response.body.should include "1.0.0".to_json
- end
- end
-end
\ No newline at end of file
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb
deleted file mode 100644
index f756c742..00000000
--- a/spec/controllers/user_controller_spec.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require 'spec_helper'
-
-describe UsersController do
- let(:bob){Fabricate(:user)}
- let(:mozart){Fabricate(:user)}
-
- describe '#index' do
- context "When user is no moderator" do
- it "try to get index" do
- get :index
- expect(response).to redirect_to(root_path)
- end
- end
-
- context "When user is moderator" do
- before { sign_in Fabricate(:user, moderator: true) }
- it "gets index with authorization" do
- get :index
- response.should be_success
- end
- end
- end
-
- describe 'Following actions' do
- before { sign_in bob }
- it 'Try to follow himself' do
- post :follow, user_id: bob, :user => {:followee => bob.id}
- expect(flash[:notice]).to eq("You can't follow yourself silly!")
- end
-
- it '#follow just once' do
- post :follow, user_id: bob, :user => {:followee => mozart.id}
- expect(flash[:notice]).to eq("You're following #{mozart.username} now")
- post :follow, user_id: bob, :user => {:followee => mozart.id}
- expect(flash[:notice]).to eq("You're already following #{mozart.username}")
- end
-
- it '#following?' do
- get :following, user_id: bob
- response.should be_success
- end
-
- it '#followers' do
- get :followers, user_id: bob
- response.should be_success
- end
-
- it '#unfollow' do
- post :unfollow, user_id: bob, :user => {:followee => mozart.id}
- expect(flash[:notice]).to eq("You're no longer following #{mozart.username}")
- end
- end
-
- describe 'Deleted user' do
- it 'should create new deleted user' do
- get :deleted_user
- response.should be_success
- end
- end
-end
diff --git a/spec/fabricators/answer_fabricator.rb b/spec/fabricators/answer_fabricator.rb
deleted file mode 100644
index 25f90dd5..00000000
--- a/spec/fabricators/answer_fabricator.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-Fabricator(:answer) do
- description "MyString"
-end
\ No newline at end of file
diff --git a/spec/fabricators/blog_post_fabricator.rb b/spec/fabricators/blog_post_fabricator.rb
deleted file mode 100644
index ff271066..00000000
--- a/spec/fabricators/blog_post_fabricator.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-Fabricator(:blog_post) do
- content "Hello, world"
- title "Title"
-end
-
-Fabricator(:another_blog_post, from: :blog_post) do
- content "World, Hello"
- title "Eltit"
-end
diff --git a/spec/fabricators/message_fabricator.rb b/spec/fabricators/message_fabricator.rb
deleted file mode 100644
index 9ec6949e..00000000
--- a/spec/fabricators/message_fabricator.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-Fabricator(:message) do
- email(count: 1) {"proof@example.com" }
- subject:"Hackety-hack email"
- body:"This is an email from hackety-hack.com"
-end
-
-Fabricator(:diffusion, from: :message) do
- email(count: 5) { |i| "proof#{i}@example.com" }
- subject:"Hackety-hack email"
- body:"This is an email from hackety-hack.com"
-end
diff --git a/spec/fabricators/program_fabricator.rb b/spec/fabricators/program_fabricator.rb
deleted file mode 100644
index 893a756a..00000000
--- a/spec/fabricators/program_fabricator.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-Fabricator(:program) do
- author_username "MyString"
- slug "MyString"
- title "MyString"
- source_code "MyString"
-end
diff --git a/spec/fabricators/question_fabricator.rb b/spec/fabricators/question_fabricator.rb
deleted file mode 100644
index 74c4c5ea..00000000
--- a/spec/fabricators/question_fabricator.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-Fabricator(:question) do
- id "RandomID"
- title "Title"
- description "Description"
- user
-end
\ No newline at end of file
diff --git a/spec/fabricators/rel_fabricator.rb b/spec/fabricators/rel_fabricator.rb
deleted file mode 100644
index 7bed38bd..00000000
--- a/spec/fabricators/rel_fabricator.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-Fabricator(:rel) do
- slug { "some_slug" }
- description { "Some description" }
-end
\ No newline at end of file
diff --git a/spec/fabricators/user_fabricator.rb b/spec/fabricators/user_fabricator.rb
deleted file mode 100644
index e12217c1..00000000
--- a/spec/fabricators/user_fabricator.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-Fabricator(:user) do
- email { sequence(:email) { |i| "user#{i}@example.com"} }
- password "password"
- password_confirmation "password"
- username { sequence(:username) { |i| "user#{i}" } }
-end
diff --git a/spec/following_policy_spec.rb b/spec/following_policy_spec.rb
deleted file mode 100644
index 0a855bbc..00000000
--- a/spec/following_policy_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require_relative '../app/models/following_policy'
-
-describe FollowingPolicy do
- before(:each) do
- @followee = double 'followee'
- @follower = double 'follower'
- end
-
- it 'can follow another' do
- @follower.should_receive(:following?).with(@followee).and_return(false)
- policy = FollowingPolicy.new(@follower)
- policy.can_follow?(@followee).should be_true
- end
-
- it "cannot follow self" do
- policy = FollowingPolicy.new(@follower)
- policy.following_self?(@follower).should be_true
- policy.can_follow?(@follower).should be_false
- end
-
- it "cannot follow twice" do
- @follower.should_receive(:following?).twice.with(@followee).and_return(true)
- policy = FollowingPolicy.new(@follower)
- policy.already_following?(@followee).should be_true
- policy.can_follow?(@followee).should be_false
- end
-
-end
diff --git a/spec/helpers/program_helper_spec.rb b/spec/helpers/program_helper_spec.rb
deleted file mode 100644
index 8a4e4c6e..00000000
--- a/spec/helpers/program_helper_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "spec_helper"
-
-describe ProgramsHelper do
- let(:simple) { Fabricate(:program) }
- let(:complicated) { Fabricate(:program, :author_username => nil) }
-
- describe "#program_link" do
- it "returns author's program path if author username exists" do
- helper.program_link(simple).should == "#{link_to(simple.title.titleize,
- user_program_path(simple.author_username, simple))}".html_safe
- end
-
- it "returns url by program's slug if author username doesn't exist" do
- helper.program_link(complicated).should == "#{link_to(complicated.title.titleize,
- url_for(:controller => '/programs',
- :action => 'show',
- :id => complicated.slug))}".html_safe
- end
- end
-end
\ No newline at end of file
diff --git a/spec/mailers/message_mailer_spec.rb b/spec/mailers/message_mailer_spec.rb
deleted file mode 100644
index b1a567fe..00000000
--- a/spec/mailers/message_mailer_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require "spec_helper"
-
-describe MessageMailer do
- let(:message) { MessageMailer.new_message(Fabricate(:message), Array("proof@example.com"))}
-
- it "is from Steve" do
- message.from.should eq(["steve@hackety.com"])
- end
-
- it "Correct subject" do
- message.subject.should eq("Hackety-hack email")
- end
-
- it "Correct receiver email" do
- message.to.should eq(["proof@example.com"])
- end
-
- it "Correct body" do
- message.body.encoded.should match("This is an email from hackety-hack.com")
- end
-end
diff --git a/spec/mailers/notification_spec.rb b/spec/mailers/notification_spec.rb
deleted file mode 100644
index 6fba9fb0..00000000
--- a/spec/mailers/notification_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require "spec_helper"
-
-describe Notification do
- describe "new_answer" do
- let(:question) { Fabricate(:question) }
- let(:mail) { Notification.new_answer(question) }
-
- it "has a link to the question" do
- mail.body.encoded.should match(question_url(question, :host => "hackety.com"))
- end
-
- it "is from Steve" do
- mail.from.should eq(["steve@hackety.com"])
- end
-
- it "is to the question's author" do
- mail.to.should eq([question.user.email])
- end
-
- it "has the proper subject" do
- mail.subject.should eq("New Answer on Hackety.com!")
- end
- end
-end
diff --git a/spec/models/deleted_user_spec.rb b/spec/models/deleted_user_spec.rb
deleted file mode 100644
index 9afc850b..00000000
--- a/spec/models/deleted_user_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'spec_helper'
-
-describe DeletedUser do
-
- before do
- @user = DeletedUser.new
- end
-
- it 'has deleted username' do
- @user.username.should == 'Deleted User'
- end
-
- it 'has no email' do
- @user.email.should == 'none'
- end
-
- it 'returns deleted user param' do
- @user.to_param.should == 'deleted_user'
- end
-end
\ No newline at end of file
diff --git a/spec/models/message.rb b/spec/models/message.rb
deleted file mode 100644
index 5caa4eb1..00000000
--- a/spec/models/message.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'spec_helper'
-
-describe Message do
- subject {Fabricate.build(:message)}
-
- describe '#to_param' do
- it 'has the email attribute' do
- subject.to_param[:email].should == subject.email
- end
-
- it'has the subject attribute' do
- subject.to_param[:subject].should == subject.subject
- end
-
- it 'has the body attribute' do
- subject.to_param[:body].should == subject.body
- end
- end
-end
\ No newline at end of file
diff --git a/spec/models/question_spec.rb b/spec/models/question_spec.rb
deleted file mode 100644
index 131fdeab..00000000
--- a/spec/models/question_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'spec_helper'
-
-describe Question do
-
- let(:question){Fabricate(:question)}
-
- it 'can be created validly' do
- question.should be_valid
- end
-
- describe 'without a user' do
- before :each do
- question.user.destroy
- @reloaded_question = Question.find question.id
- end
-
- it 'does not respond with nil when asked for its user' do
- @reloaded_question.user.should_not be_nil
- end
-
- it 'responds with something when ask for user that respodns to username' do
- @reloaded_question.user.should respond_to :username
- end
- end
-end
\ No newline at end of file
diff --git a/spec/models/rel_spec.rb b/spec/models/rel_spec.rb
deleted file mode 100644
index a614be8e..00000000
--- a/spec/models/rel_spec.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe Rel do
-
- before do
- @rel = Rel.create(:slug => 'text', :description => 'some text')
- end
-
- context 'to_param' do
- it 'returns slug' do
- @rel.to_param.should == 'text'
- end
- end
-end
\ No newline at end of file
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
deleted file mode 100644
index c8d70a56..00000000
--- a/spec/models/user_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'spec_helper'
-
-describe User do
- let(:bob){Fabricate(:user, :username => 'hacker')}
- let(:mozart){Fabricate(:user)}
- let(:hello_world){Fabricate(:program, :author_username => bob.username)}
-
- it 'can be created validly' do
- bob.should be_valid
- mozart.should be_valid
- end
-
- it 'Users can follow and unfollow' do
- bob.follow!(mozart)
- bob.following?(mozart).should be_true
- bob.unfollow!(mozart)
- bob.reload
- bob.following?(mozart).should be_false
- end
-
- describe 'programs' do
- it 'should return programs list' do
- bob.programs.class.should == Plucky::Query
- hello_world.author_username.should == 'hacker'
- bob.username.should == 'hacker'
- bob.programs.count.should == 1
- bob.programs.first.should == hello_world
- end
- end
-end
\ No newline at end of file
diff --git a/spec/presenters/question_presenter_spec.rb b/spec/presenters/question_presenter_spec.rb
deleted file mode 100644
index 13463fc7..00000000
--- a/spec/presenters/question_presenter_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'spec_helper'
-
-describe QuestionPresenter do
-
- let(:question){Fabricate(:question)}
- let(:another_question){Fabricate(:question, :id => 'AnotherID')}
- let(:answer){Fabricate(:answer, :question_id => question.id)}
-
- before do
- @qp = QuestionPresenter.new(question)
- end
-
- context 'collection_path' do
- it 'returns questions_path' do
- @qp.collection_path.should == '/questions'
- end
- end
-
- context 'edit_resource_path' do
- it 'returns edit_question_path' do
- @qp.edit_resource_path.should == '/questions/RandomID/edit'
- end
- end
-
- context 'new_resource_path' do
- it 'returns new_question_path' do
- @qp.new_resource_path.should == '/questions/new'
- end
- end
-
- context 'resource_path' do
- it 'returns self question path if nil' do
- @qp.resource_path(nil).should == '/questions/RandomID'
- end
-
- it 'returns question path if not nil' do
- @qp.resource_path(another_question).should == '/questions/AnotherID'
- end
- end
-
- context 'answers_path' do
- it 'returns questions answer path' do
- @qp.answers_path.should == '/questions/RandomID/answers'
- end
- end
-end
\ No newline at end of file
diff --git a/spec/presenters/support_presenter_spec.rb b/spec/presenters/support_presenter_spec.rb
deleted file mode 100644
index 6dd9ac83..00000000
--- a/spec/presenters/support_presenter_spec.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'spec_helper'
-
-describe SupportPresenter do
-
- let(:question){Fabricate(:question)}
- let(:another_question){Fabricate(:question, :id => 'AnotherID')}
-
- before do
- @sp = SupportPresenter.new(question)
- end
-
- context 'page_title' do
- it 'returns support questions title' do
- @sp.page_title.should == 'Support Questions'
- end
- end
-
- context 'collection_path' do
- it 'returns support questions_path' do
- @sp.collection_path.should == '/support/questions'
- end
- end
-
- context 'edit_resource_path' do
- it 'returns edit_support_question_path' do
- @sp.edit_resource_path.should == '/support/questions/RandomID/edit'
- end
- end
-
- context 'new_resource_path' do
- it 'returns new_support_question_path' do
- @sp.new_resource_path.should == '/support/questions/new'
- end
- end
-
- context 'resource_path' do
- it 'returns self question path if nil' do
- @sp.resource_path(nil).should == '/support/questions/RandomID'
- end
-
- it 'returns question path if not nil' do
- @sp.resource_path(another_question).should == '/support/questions/AnotherID'
- end
- end
-end
\ No newline at end of file
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
deleted file mode 100644
index d80bdb02..00000000
--- a/spec/spec_helper.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'code_coverage'
-
-ENV["RAILS_ENV"] ||= 'test'
-require File.expand_path("../../config/environment", __FILE__)
-require 'rspec/rails'
-require 'database_cleaner'
-require 'capybara/rspec'
-
-# Requires supporting ruby files with custom matchers and macros, etc,
-# in spec/support/ and its subdirectories.
-Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
-
-RSpec.configure do |config|
- # == Mock Framework
- #
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
- #
- # config.mock_with :mocha
- # config.mock_with :flexmock
- # config.mock_with :rr
- config.mock_with :rspec
-
- DatabaseCleaner.orm = "mongo_mapper"
- DatabaseCleaner[:mongo_mapper].strategy = :truncation
-
- config.before(:each) do
- DatabaseCleaner[:mongo_mapper].clean
- end
-
- config.include(MailerMacros)
- config.before(:each) { reset_email }
-
- config.include Devise::TestHelpers, :type => :controller
- config.include Capybara::DSL
-end
diff --git a/spec/support/mailer_macros.rb b/spec/support/mailer_macros.rb
deleted file mode 100644
index f082fda9..00000000
--- a/spec/support/mailer_macros.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-module MailerMacros
- def last_email
- ActionMailer::Base.deliveries.last
- end
-
- def reset_email
- ActionMailer::Base.deliveries = []
- end
-end
-
diff --git a/spec/unit/program_spec.rb b/spec/unit/program_spec.rb
deleted file mode 100644
index c93ba99e..00000000
--- a/spec/unit/program_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'spec_helper'
-
-describe Program do
- let(:prog) { Program.create(author_username: 'tester', title: 'test title')}
-
- it "sets the slug" do
- prog.slug.should == 'test-title'
- end
-
- it "makes unique slugs" do
- first_prog = Program.create(author_username: 'tester',
- title: 'test title #2',
- slug: 'test-title')
- prog.slug.should_not == first_prog.slug
- end
-end
diff --git a/spec/unit/sluggifier_spec.rb b/spec/unit/sluggifier_spec.rb
deleted file mode 100644
index 9cc71ce9..00000000
--- a/spec/unit/sluggifier_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# encoding: utf-8
-
-require 'active_support/all'
-require_relative '../../lib/sluggifier'
-
-describe Sluggifier do
- describe '.generate' do
- it "makes a slug from a title" do
- Sluggifier.generate('test a slug').should == 'test-a-slug'
- end
-
- context "doesn't allow multiple slugs to be the same" do
- let(:all_slugs) { ['test'] }
-
- it "appends a one if there is one repeated slug" do
- Sluggifier.generate('test',all_slugs).should == 'test-2'
- end
-
- it "appends the next sequential number for repeats" do
- all_slugs << 'test-2'
- Sluggifier.generate('test',all_slugs).should == 'test-3'
- end
- end
- end
-end
diff --git a/spec/views/programs_index.rb b/spec/views/programs_index.rb
deleted file mode 100644
index 55029cd4..00000000
--- a/spec/views/programs_index.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'spec_helper'
-
-describe 'programs/index.html.haml' do
- context 'programs without a username' do
- it "renders the page without error" do
- programs = [Fabricate(:program, author_username: nil)]
- assign(:programs, programs)
- render
- rendered.should have_selector('div', id: 'title', contents: 'MyString')
- end
- end
-end
diff --git a/spec/views/questions/index.atom.builder_spec.rb b/spec/views/questions/index.atom.builder_spec.rb
deleted file mode 100644
index 08d0faab..00000000
--- a/spec/views/questions/index.atom.builder_spec.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe 'questions/index.atom.builder' do
- let(:question) { Fabricate(:question) }
-
- before { assign(:questions, [question]) }
-
- it "renders the feed without error" do
- render
- rendered.should include(question.title)
- rendered.should include(question.description)
- rendered.should include(question.updated_at.strftime("%Y-%m-%dT%H:%M:%SZ"))
- rendered.should include(question.user.username)
- end
-end
diff --git a/spec/views/questions/index.html.haml_spec.rb b/spec/views/questions/index.html.haml_spec.rb
deleted file mode 100644
index f371781c..00000000
--- a/spec/views/questions/index.html.haml_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'spec_helper'
-
-describe 'questions/index.html.haml' do
- let(:question) { Fabricate(:question) }
-
- before(:each) do
- # stub the partials and test them individually
- stub_template "shared/_ask" => ""
- stub_template "questions/_list" => ""
-
- view.stub :will_paginate
- end
-
- it "renders an autodiscovery link in for the head content" do
- render :template => "questions/index.html.haml", :locals => {:collection => [question]}
-
- view.content_for(:head).should include(questions_url(format: :atom))
- end
-end
\ No newline at end of file
diff --git a/vendor/assets/javascripts/prettify.js b/vendor/assets/javascripts/prettify.js
deleted file mode 100644
index eef5ad7e..00000000
--- a/vendor/assets/javascripts/prettify.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
-(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
-[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
-l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
-q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
-q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
-"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
-a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
-for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
-"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
-H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
-J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
-I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]+/],["dec",/^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^