Giter VIP home page Giter VIP logo

the_next_big_thing's Introduction

The Next Big Thing Build Status Dependency Status Code Climate

What is this?

A full-fledged portal to announce the next big thing! Jumpstart the PR campaign for your next big thing by standing on the shoulder of a giant: The next big Thing!!

What is this really?

A sample project showcasing the use of unbuilt Rails Engines and Gems. The entire app has been developed using TDD - follow the commits to see the parts evolve. Current state:

  • Teaser provides the web page one sees when running the the_next_big_thing server. It depends on all the other engines.
  • Annoyance contains a service that given a number will give an indication of how annoying that number is.
  • EmailSignup provides a service allowing the storage of email addresses.
  • EventCounter provides a service that can count for any object how many times a particular action has happened.
  • The main Rails application does not contain any application code: it does not even have an app directory. It is soley responsible for encapsulating and mounting the engine in the right place.

##Resources on component-based Rails applications Twitter hashtag: #cbra - https://twitter.com/hashtag/cbra

Blog posts:

Past presentations by Ben Smith and me (mostly on this topic)

The book I am writing

Running the test suite

git clone https://github.com/shageman/the_next_big_thing.git
cd the_next_big_thing
./build.sh

Contributing

I highly appreciate it!

Fork, pull, create, commit, push, request pull.

License

Copyright (c) 2012-2013 Stephan Hagemann
twitter.com/shageman
%w(stephan.hagemann gmail.com) * "@"

Released under the MIT license. See MIT-LICENSE file for details.

the_next_big_thing's People

Contributors

agenteo avatar austinbv avatar bundacia avatar dobbs avatar hzeus avatar replaid avatar shageman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

the_next_big_thing's Issues

ruby version mismatch between components and main app

I noticed there is a mismatch with the ruby-version of the main application (2.1.0) and the components (2.1 and one 2.0). I think the latter has slipped trough and it's not intentional. The 2.1s are picking up the latest 2.1.2 creating a mismatch with what the main app will be running on (2.1.0).

Also the travis.yml is set to 2.1 which according to my build output is picking up ruby 2.1.2p95 https://travis-ci.org/agenteo/the_next_big_thing

Creating a patch to fix this will be quick, but I wanted to first touch base on which version the app should be running on.

Cheers!

build script doesn't switch rvm gemsets

When running the pushd RVM stay in the main application gem set and doesn't pick up each engine's .ruby-gemset.

Will send a pull request with the fix we're using later today.

Tests are failing on an order dependency problem

As @dobbs reported in #9, we have a flaky test suite:

passed for my repo
https://travis-ci.org/dobbs/the_next_big_thing/builds/18963862

failed for yours
https://travis-ci.org/shageman/the_next_big_thing/builds/18963868

In the passing case the annoyance specs ran first, followed by rails container specs.
In the failing case the rails container specs ran first and failed because sprockets gem and rspec command cannot be found. But reviewing previous successes and failures, I don't think it's order dependent.

Controlling the versions in Gemfile.lock doesn't solve the intermittent failure. I'm stumped.

CodeClimate analyses per component

Keenan Brock
@shageman have you figured out how to point @codeclimate at each component in github.com/shageman/the_n… so you get a score per component? - 05 Sep

Stephan Hagemann
@kbrock @codeclimate Frankly, I am not even sure on what portion of the tests it reports right now - 05 Sep

Keenan Brock
@shageman Tearing apart a big app into components. I feel @codeclimate scores per component would motivate people: "A" & "F" vs a single "D"

  • + +

This would be so awesome that I am making it an issue.

belongs_to, has_many, etc to many examples?

Hi,
How would I perform belongs_to and/or has_many using the data mapper pattern and loosely coupled engines like in your example here. For example, if I have one Account with Many Users and Admin Users. Where and how would the joining occur. If I created a new account with it's user (admin/owner), where would that go. I am picturing an Account Engine, and an User Engine but am a bit confused on the details of joining them together (my mind is still stuck in an active record world).

  • John

Deploying to heroku

Hello,
How would one go by deploying something like to heroku?

Any help would be greatly appreciated!

Make a shared testhelper example

How do you efficiently share test helper code from an engine/gem that is reused by others?

Export testhelper.

That. Add example.

event counter spec failing locally but not on CI

I checked out the project and when running build I saw the event counter engine failing with [1].

When I run its test.sh in isolation I see the same.

Looks like the auto_explain_threshold_in_seconds was removed from the dummy app production config but it's left on the development. Removing it from it fixes the problem.

diff --git a/components/event_counter/spec/dummy/config/environments/development.rb b/components/event_counter/spec/dummy/config/environments/development.rb
index 8559bc4..4b826ee 100644
--- a/components/event_counter/spec/dummy/config/environments/development.rb
+++ b/components/event_counter/spec/dummy/config/environments/development.rb
@@ -21,7 +21,7 @@ Dummy::Application.configure do

   # Log the query plan for queries taking more than this (works
   # with SQLite, MySQL, and PostgreSQL)
-  config.active_record.auto_explain_threshold_in_seconds = 0.5
+  # config.active_record.auto_explain_threshold_in_seconds = 0.5

   # Do not compress assets
   config.assets.compress = false

I am more curious to find out how come CI didn't pick this one up and/or if my development machine has something special going on.

Cheers

[1]

*** Running event counter specs
rake aborted!
NoMethodError: undefined method `auto_explain_threshold_in_seconds=' for ActiveRecord::Base:Class
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activerecord-4.1.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activerecord-4.1.1/lib/active_record/railtie.rb:110:in `block (3 levels) in <class:Railtie>'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activerecord-4.1.1/lib/active_record/railtie.rb:109:in `each'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activerecord-4.1.1/lib/active_record/railtie.rb:109:in `block (2 levels) in <class:Railtie>'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:27:in `each'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activerecord-4.1.1/lib/active_record/railtie.rb:108:in `block in <class:Railtie>'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `public_send'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `method_missing'
/Users/eteotti/sandbox/the_next_big_thing/components/event_counter/spec/dummy/config/environment.rb:5:in `<top (required)>'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/railties-4.1.1/lib/rails/application.rb:264:in `require_environment!'
/Users/eteotti/.rvm/gems/ruby-2.1.0@global/gems/railties-4.1.1/lib/rails/application.rb:367:in `block in run_tasks_blocks'
/Users/eteotti/.rvm/gems/ruby-2.1.0@tnbt/bin/ruby_executable_hooks:15:in `eval'
/Users/eteotti/.rvm/gems/ruby-2.1.0@tnbt/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate => app:db:migrate => app:environment
(See full trace by running task with --trace)
F

Failures:

  1) EventCounter::Logger#log returns the new logged count
     Failure/Error: subject.log("some_object", "some_event").should == 1
     ActiveRecord::StatementInvalid:
       SQLite3::SQLException: no such table: event_counter_counts: SELECT  "event_counter_counts".* FROM "event_counter_counts"  WHERE "event_counter_counts"."object_identifier" = 'some_object' AND "event_counter_counts"."event_identifier" = 'some_event'  ORDER BY "event_counter_counts"."id" ASC LIMIT 1
     # ./app/models/event_counter/logger.rb:4:in `log'
     # ./spec/models/logger_spec.rb:7:in `block (3 levels) in <module:EventCounter>'

Finished in 0.00563 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/models/logger_spec.rb:6 # EventCounter::Logger#log returns the new logged count

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.