redux_rails 0.1.1 → 0.1.2

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: c80cec0ad4c8eec3d6d599700037c8c138f8fd3f
4
- data.tar.gz: 5d1131af4afd5ca7fe3a6b1fd08f50b1f5f5aec7
3
+ metadata.gz: c49a8ea0a58f79e7a4f41f8f90889e39c47c3b25
4
+ data.tar.gz: 07a27fa4221f637df04524f78c6e84106d3ad3b9
5
5
  SHA512:
6
- metadata.gz: 46a4c56021cca721c039eb47bd8d9b3714ff69a6b771ce3e9daf817513c71492eb720dadc9c160400362e4135ea43c80afdae5c85ef126db702ec7bd7de2c696
7
- data.tar.gz: cd9dd9aee3dc339d130016df7861587486a5f1b7857688a12d20fd3c903000d9314f2759c70e1029b161ff9242680c2a8d65b1f7715442e3c6c5f28031c2dac8
6
+ metadata.gz: 3c3e5a1627ab759817ffa8ffaebaa669296a00a35679b6922def59c8cc8cc4aa3eb0536f5fe5820fa21504b4f29ebf467bd4ec67ff168fd4fb6c3de5ee3340e6
7
+ data.tar.gz: 61d3e933a7d2f81497777144b3b843e53d7cd76b8fbb5d00820a0e283806968811aebad5921b3387de6872935c1bc9ebad6e5d5cf5584cc981a744d3e94fd430
@@ -1,8 +1,8 @@
1
1
  module ReduxRails
2
2
  class InstallGenerator < Rails::Generators::Base
3
- source_root File.expand_path('./templates', __FILE__)
4
- argument :name, :type => :string, :default => "app"
5
-
3
+ source_root File.expand_path('../templates', __FILE__)
4
+ argument :name, :type => :string, :default => "app"
5
+
6
6
  def create_src_directory
7
7
  empty_directory("app/javascript/src")
8
8
  end
@@ -75,53 +75,53 @@ export default #{name}Reducer;"
75
75
  end
76
76
 
77
77
  def create_pack
78
- create_file "app/javascript/packs/#{name}.jsx", "
79
- import React from 'react'
80
- import { render } from 'react-dom'
81
- import { Provider } from 'react-redux'
82
- import { createStore, combineReducers, applyMiddleware } from 'redux'
83
-
84
- //this allows you to use the redux devtool in chrome
85
- import { devToolsEnhancer } from 'redux-devtools-extension'
86
-
87
- import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
88
-
89
- import #{name} from './src/components/#{name}/#{name}'
90
-
91
- import rootReducer from '../src/reducer'
92
-
93
- //this is for devToolsEnhancer otherwise would be 'let store = createStore(todoApp)'
94
- let store = createStore(todoApp, /* preloadedState, */ devToolsEnhancer(
95
- // Specify name here, actionsBlacklist, actionsCreators and other options if needed
96
- ));
97
- console.log(store.getState())
98
-
99
- // Note that subscribe() returns a function for unregistering the listener
100
- let unsubscribe = store.subscribe(() =>
101
- console.log(store.getState())
102
- )
103
-
104
- // Stop listening to state updates
105
- unsubscribe()
106
-
107
- document.addEventListener('DOMContentLoaded', () => {
108
- render(
109
- <Provider store={store}>
110
- <Router>
111
- <div>
112
- <Route exact path="/" component={#{name}} />
113
- </div>
114
- </Router>
115
- </Provider>,
116
- document.body.appendChild(document.createElement('div')),
117
- )
118
- })"
78
+ create_file "app/javascript/packs/#{name}.jsx",
79
+ "import React from 'react'
80
+ import { render } from 'react-dom'
81
+ import { Provider } from 'react-redux'
82
+ import { createStore, combineReducers, applyMiddleware } from 'redux'
83
+
84
+ //this allows you to use the redux devtool in chrome
85
+ import { devToolsEnhancer } from 'redux-devtools-extension'
86
+
87
+ import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
88
+
89
+ import #{name} from './src/components/#{name}/#{name}'
90
+
91
+ import rootReducer from '../src/reducer'
92
+
93
+ //this is for devToolsEnhancer otherwise would be 'let store = createStore(todoApp)'
94
+ let store = createStore(todoApp, /* preloadedState, */ devToolsEnhancer(
95
+ // Specify name here, actionsBlacklist, actionsCreators and other options if needed
96
+ ));
97
+ console.log(store.getState())
98
+
99
+ // Note that subscribe() returns a function for unregistering the listener
100
+ let unsubscribe = store.subscribe(() =>
101
+ console.log(store.getState())
102
+ )
103
+
104
+ // Stop listening to state updates
105
+ unsubscribe()
106
+
107
+ document.addEventListener('DOMContentLoaded', () => {
108
+ render(
109
+ <Provider store={store}>
110
+ <Router>
111
+ <div>
112
+ <Route exact path='/' component={#{name}} />
113
+ </div>
114
+ </Router>
115
+ </Provider>,
116
+ document.body.appendChild(document.createElement('div')),
117
+ )
118
+ })"
119
119
  end
120
120
 
121
121
  def insert_into_manifest
122
- inject_into_file "public/packs/manifest.json", "'#{name}.js': 'http://0.0.0.0:8080/packs/#{name}.js',\n", :after => "{\n"
123
- inject_into_file "public/packs/manifest.json", "'#{name}.css': 'http://0.0.0.0:8080/packs/#{name}.css',\n", :after => "'#{name}.js': 'http://0.0.0.0:8080/packs/#{name}.js',\n"
124
- end
122
+ inject_into_file "public/packs/manifest.json", "\"#{name}.js\" : \"http://0.0.0.0:8080/packs/#{name}.js\",\n", :after => "{\n"
125
123
 
124
+ inject_into_file "public/packs/manifest.json", "\"#{name}.css\" : \"http://0.0.0.0:8080/packs/#{name}.css\",\n", :after => "\"#{name}.js\" : \"http://0.0.0.0:8080/packs/#{name}.js\",\n"
125
+ end
126
126
  end
127
127
  end
@@ -1,3 +1,3 @@
1
1
  module ReduxRails
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/redux_rails.gemspec CHANGED
@@ -8,13 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = ReduxRails::VERSION
9
9
  spec.authors = ["Luke Popwell"]
10
10
  spec.email = ["lukepopwell@mac.com"]
11
-
12
11
  spec.summary = %q{Setup React and Redux for Rails 5.1}
13
- spec.description = %q{
14
- Complete setup for React and Redux into Rails 5.1 pipeline or later.
15
- Includes initial install generator, component and container generator.
16
- Full description of install located at https://github.com/Luke-Popwell/redux_rails
17
- }
12
+ spec.description = %q{Complete setup for React and Redux into Rails 5.1 pipeline or later. Includes initial install generator, component and container generator. Full description of install located at https://github.com/Luke-Popwell/redux_rails }
18
13
  spec.homepage = "https://github.com/Luke-Popwell/redux_rails"
19
14
  spec.license = "MIT"
20
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redux_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Popwell
@@ -52,10 +52,9 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- description: "\n Complete setup for React and Redux into Rails 5.1 pipeline or
56
- later.\n Includes initial install generator, component and container generator.\n
57
- \ Full description of install located at https://github.com/Luke-Popwell/redux_rails\n
58
- \ "
55
+ description: 'Complete setup for React and Redux into Rails 5.1 pipeline or later.
56
+ Includes initial install generator, component and container generator. Full description
57
+ of install located at https://github.com/Luke-Popwell/redux_rails '
59
58
  email:
60
59
  - lukepopwell@mac.com
61
60
  executables: []