thredded_create_app 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79d691805cc0dd79223c86c6c8df35520dd93253
4
- data.tar.gz: 43b887ec2b346f222e0a707e0c8e4b91f969143e
3
+ metadata.gz: 43c529c88409832930c874c409f84ac7e5f6cb44
4
+ data.tar.gz: 4aea74c5015e106db8602531cd736ace9ea6aa3f
5
5
  SHA512:
6
- metadata.gz: 35a0fdff1b86d5e17bc0404da332c38d830c8d626286cd82aa1db8275deb80c7979e3a79d6b9ea671e85d69fabce5aade276e494051197e002406cbc23944bc5
7
- data.tar.gz: e737e4755bedbb0a905f07ee979b005b4ef3f26cbfa4369944244fbc6bc8cb73ff1fac269bcb72d19f029083785fe3a9665cbef130e4c5c6e31e2a84e430d491
6
+ metadata.gz: 5c893690c830442227d0e27b9f52877ef4e454ce72356beafe6395dc7ecce129b61d80cb230f4e390798099710fbbe028b05a426c70dba58891dda6223177eff
7
+ data.tar.gz: 40c96f6b87029f670ce5c37c26534ab237ab9e7900ac137d529b22dd24bdaa09c2e64b8c62447d978dfb36f0380c377e81ae9663ed45e95ae63377c2340ca06c
data/README.md CHANGED
@@ -23,12 +23,41 @@ Example screenshots of the generated app:
23
23
  2. A supported database: PostgreSQL (recommended), MySQL v5.7+, or SQLite.
24
24
  3. Ruby 2.3+.
25
25
 
26
+ You may also need some packages to compile Thredded dependencies.
27
+ On Ubuntu, you can install all the required packages by running:
28
+
29
+ ```bash
30
+ sudo apt-get install autoconf automake bison build-essential gawk git \
31
+ libffi-dev libgdbm-dev libgmp-dev libncurses5-dev libpq-dev libreadline6-dev \
32
+ libsqlite3-dev libtool libyaml-dev nodejs pkg-config ruby sqlite3
33
+ ```
34
+
26
35
  ## Usage
27
36
 
28
37
  Install the gem and create your app:
29
38
 
30
39
  ```bash
31
40
  gem install thredded_create_app
41
+ ```
42
+
43
+ #### Installing the gem using system Ruby
44
+
45
+ When using the *system* Ruby on Mac or Linux (as opposed to RVM or rbenv),
46
+ the command above will fail because only root can install gems system-wide.
47
+
48
+ Instead, install `thredded_create_app` with the `--user` flag:
49
+
50
+ ```bash
51
+ gem install --user thredded_create_app
52
+ ```
53
+
54
+ The above will install the gem to the `~/.gem/` directory.
55
+
56
+ Then, [add the user gems `bin` directory to `PATH`](http://guides.rubygems.org/faqs/#user-install).
57
+
58
+ ### Create your app
59
+
60
+ ```
32
61
  thredded_create_app myapp
33
62
  ```
34
63
 
@@ -39,27 +68,6 @@ or `--datase mysql2` for MySQL.
39
68
  Run `thredded_create_app --help` for more information about the available
40
69
  options.
41
70
 
42
- ### RVM
43
-
44
- If you're using [RVM](https://rvm.io/), you probably want to create a
45
- gemset before creating your app:
46
-
47
- ```bash
48
- RUBY_VERSION=2.3.1 APP=myapp
49
- rvm use --create "${RUBY_VERSION}@${APP}"
50
- gem install thredded_create_app
51
- thredded_create_app "$APP"
52
- ```
53
-
54
- Then, generate the `.ruby-version` and `.ruby-gemset` files so that the gemset
55
- is used automatically whenever you `cd` into the project directory:
56
-
57
- ```bash
58
- cd "$APP"
59
- rvm use --ruby-version "${RUBY_VERSION}@${APP}"
60
- printf '.ruby-version\n.ruby-gemset\n' >> .git/info/exclude
61
- ```
62
-
63
71
  ### App generation
64
72
 
65
73
  The app generator will do the steps below for you.
@@ -150,6 +158,31 @@ by tweeting [@thredded]!
150
158
  [Thredded chat room]: https://gitter.im/thredded/thredded
151
159
  [Thredded Readme]: https://github.com/thredded/thredded/blob/master/README.md
152
160
 
161
+ ## Deploying to Heroku
162
+
163
+ To deploy your app to Heroku, run:
164
+
165
+ ```bash
166
+ gem install heroku # --user if using system ruby
167
+ # Create a heroku app and set the necessary environment variables
168
+ heroku create
169
+ heroku config:set RACK_ENV=production RAILS_ENV=production \
170
+ SECRET_KEY_BASE="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
171
+ # Deploy to heroku
172
+ git push heroku master
173
+ # Set up the database and some seed data (an admin user and a messageboard)
174
+ heroku run rake db:migrate db:seed
175
+ # Open the website in your default browser
176
+ heroku open
177
+ ```
178
+
179
+ You can log in as the admin user with email `admin@<app name>.com`, password
180
+ `123456`.
181
+
182
+ The app is now deployed, but you'll also need to set up emailing, either by
183
+ using one of the Heroku add-ons (there are some free ones), or by
184
+ [configuring it yourself](http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration).
185
+
153
186
  ## Development
154
187
 
155
188
  The instructions below are for developing and contributing to
@@ -2,6 +2,7 @@
2
2
  require 'thredded_create_app/command_error'
3
3
  require 'thredded_create_app/generator'
4
4
  require 'thredded_create_app/logging'
5
+ require 'thredded_create_app/version'
5
6
 
6
7
  require 'highline'
7
8
  module ThreddedCreateApp
@@ -85,7 +85,9 @@ module ThreddedCreateApp
85
85
  ("path: '#{path}'" if path)].compact.join(', ')
86
86
  end
87
87
  end
88
- run "bundle install#{' --quiet' unless verbose?}"
88
+ log_info 'Installing gems'
89
+ run "bundle install#{' --quiet' unless verbose?}" \
90
+ "#{' --path .bundle' unless File.writable?(Gem.dir)}"
89
91
  git_commit "Add gems: #{gems.map { |(name, *)| name } * ', '}"
90
92
  end
91
93
  end
@@ -68,7 +68,7 @@ module ThreddedCreateApp
68
68
  before_validation :uniq_display_name!, on: :create
69
69
 
70
70
  def display_name=(value)
71
- super(value&.strip)
71
+ super(value ? value.strip : nil)
72
72
  end
73
73
 
74
74
  RUBY
@@ -15,8 +15,10 @@ module ThreddedCreateApp
15
15
 
16
16
  def before_bundle
17
17
  if @install_gem_bundler_rails
18
- run 'gem update --system --no-document --quiet'
19
- run 'gem install bundler rails --no-document'
18
+ user_install = !File.writable?(Gem.dir)
19
+ run 'gem update --system --no-document --quiet' unless user_install
20
+ run 'gem install bundler rails --no-document' \
21
+ "#{' --user' if user_install}"
20
22
  end
21
23
  # I have no idea why this bundle exec is necessary on Travis.
22
24
  run "#{'bundle exec ' if ENV['TRAVIS']}" \
@@ -1,14 +1,13 @@
1
1
  <h1>Welcome to your new Rails app with Thredded! 🎉</h1>
2
2
 
3
+ <p>Check out the
4
+ <b><%%= link_to t('nav.forums'), thredded.root_path %></b>.
5
+ </p>
6
+
3
7
  <%% unless Rails.env.production? %>
4
8
  <p>You can now:</p>
5
9
 
6
10
  <ul>
7
- <li>
8
- <p>Check out the
9
- <b><%%= link_to t('nav.forums'), thredded.root_path %></b>.
10
- </p>
11
- </li>
12
11
  <li>
13
12
  <p>
14
13
  <b><%%= link_to 'Log in', new_user_session_path %></b> as
@@ -14,7 +14,7 @@ messageboard = Thredded::Messageboard.create!(
14
14
 
15
15
  Thredded::TopicForm.new(
16
16
  title: 'My first topic',
17
- content: <<~MARKDOWN,
17
+ content: <<-MARKDOWN,
18
18
  Hello **world**! :smile: This first post shows some of the Thredded default post
19
19
  formatting functionality.
20
20
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ThreddedCreateApp
3
- VERSION = '0.1.6'
3
+ VERSION = '0.1.7'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thredded_create_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-02 00:00:00.000000000 Z
11
+ date: 2017-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor