react_on_rails 2.0.0.beta.3 → 2.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e6a3e3f5a956072da985398fcc4a47717c1c654
4
- data.tar.gz: 54dd160efba8dfe5ce0c35c2d56fb326f5e82984
3
+ metadata.gz: 1a3532d98dcdbf8b585e955a5c605d9c884ac6df
4
+ data.tar.gz: f7b3342e9599a2ba77087bb44b4004ac38eac4df
5
5
  SHA512:
6
- metadata.gz: 7f6910bd7f55013c68d046febb69b0b709cb470351b2ce008a66580336cd9a540e1f7cf97f7480bb0a617c681e4004b284785db8e1d4d7eb75dab1a417a811cb
7
- data.tar.gz: cfbb296cbd1b90af417facd4850292eb9f76a705eadd380535dd9d50b2fdba1000212d7c46b2d248dc325bd7f6b0eab519543afecb6d436093adf616589973dc
6
+ metadata.gz: d6524e9358002a3124ffbf24620de5b7c4234ce78bf2a2851f8b32093c0d75f8189602b0a972ba94e0f4df7808fe1e29922fe680283e4ce655b7a8c9f3c2a466
7
+ data.tar.gz: 35510b925a6828dac60290ad1cb6ca803e2726f412d032d06c4338bc18fa0373b8a5261c15519c8b648a3197609e86ef76da045fedd4beede3f42bd3f5792603
@@ -30,12 +30,12 @@ install:
30
30
  - npm install
31
31
  - rake dummy_apps
32
32
  - rake examples
33
+ - rake node_package
33
34
  - docker-compose up lint
34
35
 
35
36
  before_script:
36
37
  - "export DISPLAY=:99"
37
38
  - Xvfb :99 -ac -screen scn 1600x1200x16 &
38
- - npm run symlink_node_package
39
39
 
40
40
  script:
41
41
  - rake
data/Rakefile CHANGED
@@ -1,10 +1,7 @@
1
1
  # Rake will automatically load any *.rake files inside of the "rakelib" folder
2
2
  # See rakelib/
3
+ require "coveralls/rake/task"
4
+ Coveralls::RakeTask.new
3
5
 
4
6
  desc "Run all tests and linting"
5
- task default: ["run_rspec", "docker:lint"]
6
-
7
- desc "Has all examples and dummy apps use local node_package folder for react-on-rails node dependency"
8
- task :symlink_node_package do
9
- sh_in_dir(gem_root, "npm run symlink_node_package")
10
- end
7
+ task default: ["run_rspec", "docker:lint", "coveralls:push"]
@@ -90,9 +90,18 @@ From now on, the example and dummy apps will use your local node_package folder
90
90
  ```sh
91
91
  cd <top level>
92
92
  npm i
93
- npm run build
94
- cd spec/dummy
95
- npm i
93
+ npm build
94
+ ```
95
+
96
+ Or run this which builds the npm package, then the webpack files for spec/dummy, and runs tests in
97
+ spec/dummy.
98
+
99
+
100
+ ```sh
101
+ # Optionally change default selenium_firefox driver
102
+ export DRIVER=poltergeist
103
+ cd <top level>
104
+ npm dummy:spec
96
105
  ```
97
106
 
98
107
  ### Run NPM JS tests
@@ -27,3 +27,18 @@ gem release
27
27
  Be sure to keep the version number the same as the ruby gem!
28
28
 
29
29
  Use the npm package `release-it`
30
+
31
+ ### Commands Used for Pushing Beta
32
+
33
+ Note the npm beta version has a dash and the gem version has a dot.
34
+
35
+ ```
36
+ gem bump -v 2.0.0.beta.3
37
+ gem tag
38
+ cd spec/dummy && bundle
39
+ ga Gemfile.lock
40
+ gc -m "Update Gemfile.lock for spec/dummy"
41
+ ...
42
+ gem release
43
+ release-it 2.0.0-beta.3
44
+ ```
@@ -10,10 +10,10 @@ export default function helloWorldReducer($$state = $$initialState, action) {
10
10
  const { type, name } = action;
11
11
 
12
12
  switch (type) {
13
- case actionTypes.HELLO_WORLD_NAME_UPDATE:
14
- return $$state.set('name', name);
13
+ case actionTypes.HELLO_WORLD_NAME_UPDATE:
14
+ return $$state.set('name', name);
15
15
 
16
- default:
17
- return $$state;
16
+ default:
17
+ return $$state;
18
18
  }
19
19
  }
@@ -1,3 +1,3 @@
1
1
  module ReactOnRails
2
- VERSION = "2.0.0.beta.3"
2
+ VERSION = "2.0.0.rc.1"
3
3
  end
@@ -13,10 +13,8 @@ module ReactOnRails
13
13
  # For compatibility, the gem and the node package versions should always match, unless the user
14
14
  # really knows what they're doing. So we will give a warning if they do not.
15
15
  def self.warn_if_gem_and_node_package_versions_differ
16
- return unless
17
- File.exist?(client_package_json) &&
18
- node_package_version_is_standard_version_number? &&
19
- gem_version != node_package_version
16
+ return unless node_package_version_is_standard_version_number? &&
17
+ gem_version != node_package_version
20
18
  msg = "**WARNING** ReactOnRails: ReactOnRails gem and node package versions do not match\n" \
21
19
  " gem: #{gem_version}\n" \
22
20
  " node package: #{node_package_version}\n" \
@@ -33,14 +31,15 @@ module ReactOnRails
33
31
 
34
32
  # Warning: we replace all hyphens with periods for normalization purposes
35
33
  def self.node_package_version
36
- package_json = client_package_json
37
- contents = File.read(package_json)
34
+ return unless client_package_json.present? && File.exist?(client_package_json)
35
+ contents = File.read(client_package_json)
38
36
  raw_version = contents.match(/"react-on-rails": "(.*)",/)[1]
39
37
  raw_version.tr("-", ".")
40
38
  end
41
39
 
42
40
  def self.client_package_json
43
- package_json = Rails.root.join("client", "package.json")
41
+ return unless Rails.root.present?
42
+ Rails.root.join("client", "package.json")
44
43
  end
45
44
 
46
45
  # Basically this means "not a relative path" as we don't want warn the user
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5
5
  "main": "node_package/lib/ReactOnRails.js",
6
6
  "directories": {
@@ -6,6 +6,8 @@ namespace :dummy_apps do
6
6
  dummy_app_dir = File.join(gem_root, "spec/dummy")
7
7
  bundle_install_in(dummy_app_dir)
8
8
  dummy_app_client_dir = File.join(dummy_app_dir, "client")
9
+
10
+ # Note, we do not put in "npm build" as npm install does that!
9
11
  sh_in_dir(dummy_app_client_dir, ["npm install",
10
12
  "$(npm bin)/webpack --config webpack.server.js",
11
13
  "$(npm bin)/webpack --config webpack.client.js"])
@@ -72,7 +72,7 @@ namespace :examples do
72
72
  # PREPARE
73
73
  desc "Prepares #{example_type.name_pretty} (generates example, `npm install`s, and generates webpack bundles)"
74
74
  multitask example_type.prepare_task_name_short => example_type.prepared_files do
75
- Rake::Task[:refresh_node_package].invoke
75
+ Rake::Task["node_package"].invoke
76
76
  end
77
77
  end
78
78
 
@@ -5,7 +5,14 @@ namespace :node_package do
5
5
  task :build do
6
6
  sh 'npm run build'
7
7
  end
8
+
9
+ desc "Has all examples and dummy apps use local node_package folder for react-on-rails node dependency"
10
+ task :symlink do
11
+ sh_in_dir(gem_root, "npm run symlink-node-package")
12
+ end
8
13
  end
9
14
 
10
- desc "Prepares all node_package by building"
11
- task node_package: ["node_package:build"]
15
+ desc "Prepares node_package by building and symlinking any example/dummy apps present"
16
+ task node_package: "node_package:build" do
17
+ Rake::Task["node_package:symlink"].invoke
18
+ end
@@ -37,7 +37,7 @@ namespace :run_rspec do
37
37
  Coveralls::RakeTask.new
38
38
 
39
39
  desc "run all tests"
40
- task run_rspec: [:gem, :dummy, :examples, :empty, :js_tests, "coveralls:push"] do
40
+ task run_rspec: [:gem, :dummy, :examples, :empty, :js_tests] do
41
41
  puts "Completed all RSpec tests"
42
42
  end
43
43
  end
@@ -0,0 +1,33 @@
1
+ #!/bin/sh
2
+
3
+ # script/bootstrap: Resolve all dependencies that the application requires to
4
+ # run.
5
+
6
+ set -e
7
+
8
+ cd "$(dirname "$0")/.."
9
+
10
+ if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
11
+ brew update
12
+
13
+ brew bundle check 2>&1 >/dev/null || {
14
+ echo "==> Installing Homebrew dependencies…"
15
+ brew bundle
16
+ }
17
+ fi
18
+
19
+ if [ -f ".ruby-version" ] && [ -z "$(rbenv version-name 2>/dev/null)" ]; then
20
+ echo "==> Installing Ruby…"
21
+ rbenv install --skip-existing
22
+ which bundle 2>&1 >/dev/null || {
23
+ gem install bundler
24
+ rbenv rehash
25
+ }
26
+ fi
27
+
28
+ if [ -f "Gemfile" ]; then
29
+ echo "==> Installing gem dependencies…"
30
+ bundle check --path vendor/gems 2>&1 >/dev/null || {
31
+ bundle install --path vendor/gems --quiet --without production
32
+ }
33
+ fi
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ echo see docs/releasing.md
@@ -0,0 +1,23 @@
1
+ #!/bin/sh
2
+
3
+ # script/setup: Set up application for the first time after cloning, or set it
4
+ # back to the initial first unused state.
5
+
6
+ set -e
7
+
8
+ cd "$(dirname "$0")/.."
9
+
10
+ script/bootstrap
11
+
12
+ echo "===> Setting up DB..."
13
+ # reset database to a fresh state.
14
+ bin/rake db:create db:reset
15
+
16
+ if [ -z "$RAILS_ENV" ] && [ -z "$RACK_ENV" ]; then
17
+ # Only things for a development environment will run inside here
18
+ # Do things that need to be done to the application to set up for the first
19
+ # time. Or things needed to be run to to reset the application back to first
20
+ # use experience. These things are scoped to the application's domain.
21
+ fi
22
+
23
+ echo "==> App is now ready to go!"
@@ -0,0 +1,38 @@
1
+ #!/bin/sh
2
+
3
+ # script/test: Run test suite for application. Optionally pass in a path to an
4
+ # individual test file to run a single test.
5
+
6
+
7
+ set -e
8
+
9
+ cd "$(dirname "$0")/.."
10
+
11
+ [ -z "$DEBUG" ] || set -x
12
+
13
+ export RACK_ROOT=$(cd "$(dirname $0)"/.. && pwd)
14
+
15
+ if [ "$RAILS_ENV" = "test" ] || [ "$RACK_ENV" = "test" ]; then
16
+ # if executed and the environment is already set to `test`, then we want a
17
+ # clean from scratch application. This almost always means a ci environment,
18
+ # since we set the environment to `test` directly in `script/cibuild`.
19
+ script/setup
20
+ else
21
+ # if the environment isn't set to `test`, set it to `test` and update the
22
+ # application to ensure all dependencies are met as well as any other things
23
+ # that need to be up to date, like db migrations. The environement not having
24
+ # already been set to `test` almost always means this is being called on it's
25
+ # own from a `development` environment.
26
+ export RAILS_ENV="test" RACK_ENV="test"
27
+
28
+ script/update
29
+ fi
30
+
31
+ echo "===> Running tests..."
32
+
33
+ if [ -n "$1" ]; then
34
+ # pass arguments to test call. This is useful for calling a single test.
35
+ bin/rake test "$1"
36
+ else
37
+ bin/rake test
38
+ fi
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta.3
4
+ version: 2.0.0.rc.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-02 00:00:00.000000000 Z
11
+ date: 2016-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -247,6 +247,10 @@ files:
247
247
  - rakelib/task_helpers.rb
248
248
  - react_on_rails.gemspec
249
249
  - ruby-lint.yml
250
+ - script/bootstrap
251
+ - script/release
252
+ - script/setup
253
+ - script/test
250
254
  homepage: https://github.com/shakacode/react_on_rails
251
255
  licenses:
252
256
  - MIT