first commit

This commit is contained in:
huang 2018-01-23 18:18:04 +08:00
parent 7cb0edc57b
commit b7162696cd
6 changed files with 159 additions and 117 deletions

View File

@ -28,31 +28,21 @@
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="Gemfile" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/Gemfile">
<file leaf-file-name="application_helper.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/helpers/application_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.26086956">
<caret line="37" column="0" selection-start-line="37" selection-start-column="0" selection-end-line="37" selection-end-column="0" />
<state vertical-scroll-proportion="0.0">
<caret line="13" column="24" selection-start-line="13" selection-start-column="24" selection-end-line="13" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="welcomes_controller_test.rb" pinned="false" current-in-tab="false">
<file leaf-file-name="welcomes_controller_test.rb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/test/controllers/welcomes_controller_test.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="8" column="27" selection-start-line="8" selection-start-column="27" selection-end-line="8" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="welcomes_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/welcomes_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="7" column="0" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
<state vertical-scroll-proportion="0.68686867">
<caret line="20" column="3" selection-start-line="20" selection-start-column="3" selection-end-line="20" selection-end-column="3" />
<folding />
</state>
</provider>
@ -61,58 +51,18 @@
<file leaf-file-name="application.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/layouts/application.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-2.6153846">
<caret line="4" column="18" selection-start-line="4" selection-start-column="18" selection-end-line="4" selection-end-column="18" />
<state vertical-scroll-proportion="-7.8461537">
<caret line="12" column="0" selection-start-line="12" selection-start-column="0" selection-end-line="12" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="capture_helper.rb" pinned="false" current-in-tab="false">
<entry file="file://$USER_HOME$/.rvm/gems/ruby-2.3.0/gems/actionview-4.2.8/lib/action_view/helpers/capture_helper.rb">
<file leaf-file-name="Guardfile" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Guardfile">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="164" column="27" selection-start-line="164" selection-start-column="20" selection-end-line="164" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="application_helper.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/helpers/application_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="14" column="37" selection-start-line="14" selection-start-column="36" selection-end-line="14" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="test_helper.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/test_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="12" column="3" selection-start-line="12" selection-start-column="3" selection-end-line="12" selection-end-column="3" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="application.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/config/application.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="23" column="4" selection-start-line="23" selection-start-column="4" selection-end-line="23" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="test.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/config/environments/test.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="16" column="54" selection-start-line="16" selection-start-column="2" selection-end-line="16" selection-end-column="54" />
<caret line="13" column="29" selection-start-line="13" selection-start-column="29" selection-end-line="13" selection-end-column="29" />
<folding />
</state>
</provider>
@ -129,12 +79,13 @@
<option value="$PROJECT_DIR$/config/application.rb" />
<option value="$PROJECT_DIR$/app/views/welcomes/home.html.erb" />
<option value="$PROJECT_DIR$/app/views/welcomes/help.html.erb" />
<option value="$PROJECT_DIR$/app/helpers/application_helper.rb" />
<option value="$PROJECT_DIR$/app/views/layouts/application.html.erb" />
<option value="$PROJECT_DIR$/config/routes.rb" />
<option value="$PROJECT_DIR$/test/controllers/welcomes_controller_test.rb" />
<option value="$PROJECT_DIR$/test/test_helper.rb" />
<option value="$PROJECT_DIR$/Gemfile" />
<option value="$PROJECT_DIR$/config/initializers/backtrace_silencers.rb" />
<option value="$PROJECT_DIR$/config/routes.rb" />
<option value="$PROJECT_DIR$/test/controllers/welcomes_controller_test.rb" />
<option value="$PROJECT_DIR$/app/helpers/application_helper.rb" />
</list>
</option>
</component>
@ -153,7 +104,7 @@
<order />
</component>
<component name="ProjectFrameBounds">
<option name="x" value="880" />
<option name="x" value="764" />
<option name="y" value="52" />
<option name="width" value="881" />
<option name="height" value="818" />
@ -232,6 +183,38 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="uask" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="uask" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="config" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="uask" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="uask" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="config" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="initializers" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="uask" />
@ -535,12 +518,12 @@
<servers />
</component>
<component name="ToolWindowManager">
<frame x="880" y="52" width="881" height="818" extended-state="0" />
<frame x="764" y="52" width="881" height="818" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.37018633" sideWeight="0.47679892" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.4364123" sideWeight="0.29580837" order="8" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.29718876" sideWeight="0.29580837" order="8" side_tool="true" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32907802" sideWeight="0.49358425" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
@ -550,7 +533,7 @@
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33291924" sideWeight="0.48621386" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.4364123" sideWeight="0.7041916" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.29718876" sideWeight="0.7041916" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
@ -683,64 +666,80 @@
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/welcomes_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<state vertical-scroll-proportion="0.24040404">
<caret line="7" column="0" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rvm/gems/ruby-2.3.0/gems/actionview-4.2.8/lib/action_view/helpers/capture_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.3010101">
<caret line="164" column="27" selection-start-line="164" selection-start-column="20" selection-end-line="164" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/test_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.4121212">
<caret line="12" column="3" selection-start-line="12" selection-start-column="3" selection-end-line="12" selection-end-column="3" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/initializers/backtrace_silencers.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.24040404">
<caret line="7" column="0" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.034343433">
<caret line="1" column="36" selection-start-line="1" selection-start-column="36" selection-end-line="1" selection-end-column="36" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-4.25">
<caret line="40" column="0" selection-start-line="40" selection-start-column="0" selection-end-line="40" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Guardfile">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="13" column="29" selection-start-line="13" selection-start-column="29" selection-end-line="13" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/layouts/application.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-7.8461537">
<caret line="12" column="0" selection-start-line="12" selection-start-column="0" selection-end-line="12" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/helpers/application_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="14" column="37" selection-start-line="14" selection-start-column="36" selection-end-line="14" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/layouts/application.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-2.6153846">
<caret line="4" column="18" selection-start-line="4" selection-start-column="18" selection-end-line="4" selection-end-column="18" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rvm/gems/ruby-2.3.0/gems/actionview-4.2.8/lib/action_view/helpers/capture_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="164" column="27" selection-start-line="164" selection-start-column="20" selection-end-line="164" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.11358575">
<caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
<caret line="13" column="24" selection-start-line="13" selection-start-column="24" selection-end-line="13" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/controllers/welcomes_controller_test.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="8" column="27" selection-start-line="8" selection-start-column="27" selection-end-line="8" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/test_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="12" column="3" selection-start-line="12" selection-start-column="3" selection-end-line="12" selection-end-column="3" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.26086956">
<caret line="37" column="0" selection-start-line="37" selection-start-column="0" selection-end-line="37" selection-end-column="0" />
<state vertical-scroll-proportion="0.68686867">
<caret line="20" column="3" selection-start-line="20" selection-start-column="3" selection-end-line="20" selection-end-column="3" />
<folding />
</state>
</provider>

42
Guardfile Normal file
View File

@ -0,0 +1,42 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features) \
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
## the Guardfile to a watched dir and symlink it back, e.g.
#
# $ mkdir config
# $ mv Guardfile config/
# $ ln -s config/Guardfile .
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
guard :minitest do
# with Minitest::Unit
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
watch(%r{^test/test_helper\.rb$}) { 'test' }
# with Minitest::Spec
# watch(%r{^spec/(.*)_spec\.rb$})
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
# watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
# Rails 4
# watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
# watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
# watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
# watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
# watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
# watch(%r{^test/.+_test\.rb$})
# watch(%r{^test/test_helper\.rb$}) { 'test' }
# Rails < 4
# watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
# watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
# watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
end

View File

@ -8,10 +8,11 @@ module ApplicationHelper
# html_title 'Foo', 'Bar'
# html_title # => 'Foo - Bar - My Project - Uask'
def html_title(*args)
base_title = "优答让创新更美好"
if args.empty?
title = @html_title || []
title << params[:controller]
title << "优答让创新更美好"
title << base_title
title.reject(&:blank?).join(' - ')
else
@html_title ||= []

View File

@ -1,7 +1,7 @@
# 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/ }
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /rvm/ }
# 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!

View File

@ -1,5 +1,5 @@
Rails.application.routes.draw do
root 'welcomes#home'
root 'welcomes#home', :as => "home"
get 'welcomes/help'

View File

@ -7,7 +7,7 @@ class WelcomesControllerTest < ActionDispatch::IntegrationTest
end
test "should get home" do
get welcomes_home_url
get home_url
assert_response :success
assert_select "title", "welcomes - #{@base_title}"
end