Browse files

Using Cowboy 0.8.2 and config file

  • Loading branch information...
1 parent 9cd80e5 commit 153b063c46c2822f0891e38deb062fbc7f058002 @rambocoder committed Mar 19, 2013
View
6 .idea/compiler.xml
@@ -15,7 +15,11 @@
<entry name="?*.tld" />
<entry name="?*.ftl" />
</wildcardResourcePatterns>
- <annotationProcessing enabled="false" useClasspath="true" />
+ <annotationProcessing>
+ <profile default="true" name="Default" enabled="false">
+ <processorPath useClasspath="true" />
+ </profile>
+ </annotationProcessing>
</component>
</project>
View
323 .idea/workspace.xml
@@ -3,14 +3,19 @@
<component name="ChangeListManager">
<list default="true" id="64b9ed1d-f865-415f-8849-671d66542d8b" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/priv/erlanghub.sqlite" afterPath="$PROJECT_DIR$/priv/erlanghub.sqlite" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/vcs.xml" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/rebar.config" afterPath="$PROJECT_DIR$/rebar.config" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/erlanghub_app.erl" afterPath="$PROJECT_DIR$/src/erlanghub_app.erl" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/compiler.xml" afterPath="$PROJECT_DIR$/.idea/compiler.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/default_handler.erl" afterPath="$PROJECT_DIR$/src/default_handler.erl" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/erlanghub_cowboy.erl" afterPath="$PROJECT_DIR$/src/erlanghub_cowboy.erl" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/erlanghub_pull_handler.erl" afterPath="$PROJECT_DIR$/src/erlanghub_pull_handler.erl" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/github_server.erl" afterPath="$PROJECT_DIR$/src/github_server.erl" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/start.sh" afterPath="$PROJECT_DIR$/start.sh" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<ignored path="erlanghub.iws" />
<ignored path=".idea/workspace.xml" />
+ <file path="/Dummy.txt" changelist="64b9ed1d-f865-415f-8849-671d66542d8b" time="1363707741102" ignored="false" />
+ <file path="/github_server.erl" changelist="64b9ed1d-f865-415f-8849-671d66542d8b" time="1363708191300" ignored="false" />
+ <file path="/erlanghub_cowboy.erl" changelist="64b9ed1d-f865-415f-8849-671d66542d8b" time="1363709195420" ignored="false" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -25,14 +30,15 @@
<disable_hints />
</component>
<component name="DebuggerManager">
- <breakpoint_any>
+ <breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true">
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
+ <option name="SUSPEND" value="true" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
@@ -48,6 +54,7 @@
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
+ <option name="SUSPEND" value="true" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
@@ -57,90 +64,92 @@
<option name="LOG_MESSAGE" value="" />
</breakpoint>
</breakpoint_any>
+ <ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" />
<breakpoint_rules />
<ui_properties />
</component>
+ <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="erlanghub" />
</component>
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="start.sh" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/start.sh">
+ <file leaf-file-name="erlanghub_cowboy.erl" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/erlanghub_cowboy.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="2" column="64" selection-start="88" selection-end="88" vertical-scroll-proportion="0.0">
+ <state line="17" column="4" selection-start="478" selection-end="478" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="erlanghub_cowboy.erl" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/erlanghub_cowboy.erl">
+ <file leaf-file-name="index.html" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/priv/html/index.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="4" column="0" selection-start="49" selection-end="49" vertical-scroll-proportion="0.0">
+ <state line="24" column="4" selection-start="1117" selection-end="1117" vertical-scroll-proportion="0.7070707">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="erlanghub_app.erl" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/erlanghub_app.erl">
+ <file leaf-file-name="home.js" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/priv/static/home.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="9" column="41" selection-start="242" selection-end="242" vertical-scroll-proportion="0.0">
+ <state line="59" column="31" selection-start="1699" selection-end="1699" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="erlanghub_sup.erl" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/erlanghub_sup.erl">
+ <file leaf-file-name="test.txt" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/priv/static/test.txt">
<provider selected="true" editor-type-id="text-editor">
- <state line="19" column="23" selection-start="460" selection-end="460" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="supervisor.erl" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/deps/gproc/patches/stdlib/supervisor.erl">
+ <file leaf-file-name="default_handler.erl" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/default_handler.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="71" column="0" selection-start="2050" selection-end="2050" vertical-scroll-proportion="0.0">
+ <state line="3" column="22" selection-start="109" selection-end="109" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="useful snippets.txt" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/useful snippets.txt">
+ <file leaf-file-name="cowboy_http_handler.erl" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/deps/cowboy/src/cowboy_http_handler.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="50" column="47" selection-start="2207" selection-end="2207" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="home.js" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/priv/static/home.js">
+ <file leaf-file-name="erlanghub_pull_handler.erl" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/erlanghub_pull_handler.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="8" column="23" selection-start="182" selection-end="182" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="index.html" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/priv/html/index.html">
+ <file leaf-file-name="erlanghub_app.erl" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/erlanghub_app.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="37" selection-start="457" selection-end="457" vertical-scroll-proportion="-5.2916665">
+ <state line="9" column="41" selection-start="242" selection-end="242" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="rebar.config" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/rebar.config">
+ <file leaf-file-name="erlanghub_sup.erl" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/erlanghub_sup.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="6" column="80" selection-start="484" selection-end="484" vertical-scroll-proportion="0.2616279">
+ <state line="19" column="23" selection-start="460" selection-end="460" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -149,7 +158,7 @@
<file leaf-file-name="github_server.erl" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/github_server.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="11" column="18" selection-start="219" selection-end="219" vertical-scroll-proportion="0.0">
+ <state line="30" column="0" selection-start="707" selection-end="707" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -167,12 +176,13 @@
</component>
<component name="GitLogSettings">
<option name="myStructureFilterPaths" />
+ <option name="myDateState">
+ <MyDateState />
+ </option>
</component>
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
- <option value="$PROJECT_DIR$/src/home_handler.erl" />
- <option value="$PROJECT_DIR$/src/default_handler.erl" />
<option value="$PROJECT_DIR$/src/repo_server.erl" />
<option value="$PROJECT_DIR$/priv/static/home.js" />
<option value="$PROJECT_DIR$/priv/html/index.html" />
@@ -184,8 +194,10 @@
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/start.sh" />
<option value="$PROJECT_DIR$/rebar.config" />
- <option value="$PROJECT_DIR$/src/erlanghub_cowboy.erl" />
<option value="$PROJECT_DIR$/src/erlanghub_app.erl" />
+ <option value="$PROJECT_DIR$/src/default_handler.erl" />
+ <option value="$PROJECT_DIR$/src/erlanghub_pull_handler.erl" />
+ <option value="$PROJECT_DIR$/src/erlanghub_cowboy.erl" />
<option value="$PROJECT_DIR$/src/github_server.erl" />
</list>
</option>
@@ -254,14 +266,54 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
- </subPane>
- </pane>
- <pane id="Scope">
- <subPane subId="Project Files">
<PATH>
- <PATH_ELEMENT USER_OBJECT="Root">
- <option name="myItemId" value="" />
- <option name="myItemType" value="" />
+ <PATH_ELEMENT>
+ <option name="myItemId" value="erlanghub" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="erlanghub" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="priv" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="erlanghub" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="erlanghub" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="priv" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="static" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="erlanghub" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="erlanghub" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="priv" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="html" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
@@ -280,19 +332,30 @@
</PATH>
</subPane>
</pane>
+ <pane id="Scope">
+ <subPane subId="Project Files">
+ <PATH>
+ <PATH_ELEMENT USER_OBJECT="Root">
+ <option name="myItemId" value="" />
+ <option name="myItemType" value="" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="options.splitter.main.proportions" value="0.3" />
- <property name="options.lastSelected" value="reference.settingsdialog.go.app.engine" />
<property name="MemberChooser.sorted" value="false" />
+ <property name="options.lastSelected" value="reference.settingsdialog.go.app.engine" />
+ <property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" />
- <property name="options.searchVisible" value="true" />
- <property name="options.splitter.details.proportions" value="0.2" />
<property name="MemberChooser.copyJavadoc" value="false" />
+ <property name="options.splitter.details.proportions" value="0.2" />
+ <property name="options.searchVisible" value="true" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
@@ -310,37 +373,48 @@
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m" />
<option name="PROGRAM_PARAMETERS" />
- <method>
- <option name="AntTarget" enabled="false" />
- <option name="BuildArtifacts" enabled="false" />
- <option name="Make" enabled="true" />
- <option name="Maven.BeforeRunTask" enabled="false" />
- </method>
+ <method />
+ </configuration>
+ <configuration default="true" type="ErlangApplicationRunConfiguration" factoryName="Erlang Application">
+ <module name="" />
+ <option name="moduleAndFunction" value="" />
+ <option name="name" value="Erlang Application" />
+ <option name="params" value="" />
+ <option name="saveOutputToFile" value="false" />
+ <option name="showConsoleOnStdErr" value="false" />
+ <option name="showConsoleOnStdOut" value="false" />
+ <method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
- <method>
- <option name="AntTarget" enabled="false" />
- <option name="BuildArtifacts" enabled="false" />
- <option name="Maven.BeforeRunTask" enabled="false" />
- </method>
+ <method />
</configuration>
- <configuration default="true" type="ErlangApplicationRunConfiguration" factoryName="Erlang application">
+ <configuration default="true" type="ErlangUnitRunConfigurationType" factoryName="Erlang Eunit">
<module name="" />
<option name="moduleAndFunction" value="" />
- <option name="name" value="Erlang application" />
+ <option name="name" value="Erlang" />
<option name="params" value="" />
<option name="saveOutputToFile" value="false" />
- <method>
- <option name="AntTarget" enabled="false" />
- <option name="BuildArtifacts" enabled="false" />
- <option name="Make" enabled="true" />
- <option name="Maven.BeforeRunTask" enabled="false" />
- </method>
+ <option name="showConsoleOnStdErr" value="false" />
+ <option name="showConsoleOnStdOut" value="false" />
+ <method />
+ </configuration>
+ <configuration default="true" type="Applet" factoryName="Applet">
+ <module name="" />
+ <option name="MAIN_CLASS_NAME" />
+ <option name="HTML_FILE_NAME" />
+ <option name="HTML_USED" value="false" />
+ <option name="WIDTH" value="400" />
+ <option name="HEIGHT" value="300" />
+ <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
+ <option name="VM_PARAMETERS" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+ <option name="ALTERNATIVE_JRE_PATH" />
+ <method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<module name="" />
@@ -367,30 +441,7 @@
<envs />
<properties />
<listeners />
- <method>
- <option name="AntTarget" enabled="false" />
- <option name="BuildArtifacts" enabled="false" />
- <option name="Make" enabled="true" />
- <option name="Maven.BeforeRunTask" enabled="false" />
- </method>
- </configuration>
- <configuration default="true" type="Applet" factoryName="Applet">
- <module name="" />
- <option name="MAIN_CLASS_NAME" />
- <option name="HTML_FILE_NAME" />
- <option name="HTML_USED" value="false" />
- <option name="WIDTH" value="400" />
- <option name="HEIGHT" value="300" />
- <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
- <option name="VM_PARAMETERS" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" />
- <method>
- <option name="AntTarget" enabled="false" />
- <option name="BuildArtifacts" enabled="false" />
- <option name="Make" enabled="true" />
- <option name="Maven.BeforeRunTask" enabled="false" />
- </method>
+ <method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" />
@@ -404,12 +455,7 @@
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
- <method>
- <option name="AntTarget" enabled="false" />
- <option name="BuildArtifacts" enabled="false" />
- <option name="Make" enabled="true" />
- <option name="Maven.BeforeRunTask" enabled="false" />
- </method>
+ <method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<module name="" />
@@ -429,14 +475,22 @@
</option>
<envs />
<patterns />
+ <method />
+ </configuration>
+ <list size="0" />
+ <configuration default="true" type="ErlangApplicationRunConfiguration" factoryName="Erlang application">
+ <module name="" />
+ <option name="moduleAndFunction" value="" />
+ <option name="name" value="Erlang application" />
+ <option name="params" value="" />
+ <option name="saveOutputToFile" value="false" />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
- <list size="0" />
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
@@ -470,10 +524,10 @@
<servers />
</component>
<component name="ToolWindowManager">
- <frame x="-1" y="24" width="1380" height="793" extended-state="6" />
+ <frame x="-1" y="24" width="1380" height="793" extended-state="0" />
<editor active="false" />
<layout>
- <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.41379312" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.41294298" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="JetGradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
@@ -485,7 +539,7 @@
<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="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22423802" sideWeight="0.5862069" order="0" side_tool="false" content_ui="combo" />
+ <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22406015" sideWeight="0.587057" order="0" side_tool="false" content_ui="combo" />
<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" />
<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" />
@@ -516,7 +570,6 @@
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
- <option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
@@ -526,9 +579,11 @@
<option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
<option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
<option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
- <option name="CREATE_PATCH_EXPAND_DETAILS_DEFAULT" value="true" />
<option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
<option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="false" />
+ <option name="SHOW_DIRTY_RECURSIVELY" value="false" />
+ <option name="LIMIT_HISTORY" value="true" />
+ <option name="MAXIMUM_HISTORY_ROWS" value="1000" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
<option name="LAST_COMMIT_MESSAGE" />
@@ -549,108 +604,112 @@
<breakpoint-manager />
</component>
<component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/deps/tinymq/src/tinymq_channel_sup.erl">
+ <entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="55" selection-start="269" selection-end="269" vertical-scroll-proportion="0.0" />
+ <state line="0" column="11" selection-start="11" selection-end="11" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/deps/tinymq/src/tinymq.erl">
+ <entry file="file://$PROJECT_DIR$/useful snippets.txt">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/repo_server.erl">
+ <entry file="file://$PROJECT_DIR$/start.sh">
<provider selected="true" editor-type-id="text-editor">
- <state line="79" column="17" selection-start="2585" selection-end="2585" vertical-scroll-proportion="0.0" />
+ <state line="2" column="64" selection-start="88" selection-end="88" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/deps/tinymq/src/tinymq_sup.erl">
+ <entry file="file://$PROJECT_DIR$/rebar.config">
<provider selected="true" editor-type-id="text-editor">
- <state line="9" column="21" selection-start="130" selection-end="130" vertical-scroll-proportion="0.0">
+ <state line="6" column="80" selection-start="484" selection-end="484" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/README.md">
+ <entry file="file://$PROJECT_DIR$/src/repo_server.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="16" column="17" selection-start="468" selection-end="468" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/.gitignore">
+ <entry file="file://$PROJECT_DIR$/src/erlanghub.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="11" selection-start="11" selection-end="11" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/useful snippets.txt">
+ <entry file="file://$PROJECT_DIR$/src/erlanghub_sup.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="19" column="23" selection-start="460" selection-end="460" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/priv/static/home.js">
+ <entry file="file://$PROJECT_DIR$/src/erlanghub_app.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="8" column="23" selection-start="182" selection-end="182" vertical-scroll-proportion="0.0">
+ <state line="9" column="41" selection-start="242" selection-end="242" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/priv/html/index.html">
+ <entry file="file://$PROJECT_DIR$/src/default_handler.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="37" selection-start="457" selection-end="457" vertical-scroll-proportion="-5.2916665">
+ <state line="3" column="22" selection-start="109" selection-end="109" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/start.sh">
+ <entry file="file://$PROJECT_DIR$/deps/cowboy/src/cowboy_http_handler.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="2" column="64" selection-start="88" selection-end="88" vertical-scroll-proportion="0.0">
+ <state line="50" column="47" selection-start="2207" selection-end="2207" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/erlanghub_sup.erl">
+ <entry file="file://$PROJECT_DIR$/priv/static/test.txt">
<provider selected="true" editor-type-id="text-editor">
- <state line="19" column="23" selection-start="460" selection-end="460" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/deps/gproc/patches/stdlib/supervisor.erl">
+ <entry file="file://$PROJECT_DIR$/priv/static/home.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="71" column="0" selection-start="2050" selection-end="2050" vertical-scroll-proportion="0.0">
+ <state line="59" column="31" selection-start="1699" selection-end="1699" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/erlanghub_cowboy.erl">
+ <entry file="file://$PROJECT_DIR$/src/erlanghub_pull_handler.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="4" column="0" selection-start="49" selection-end="49" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/github_server.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="11" column="18" selection-start="219" selection-end="219" vertical-scroll-proportion="0.0">
+ <state line="30" column="0" selection-start="707" selection-end="707" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/erlanghub_app.erl">
+ <entry file="file://$PROJECT_DIR$/src/erlanghub_cowboy.erl">
<provider selected="true" editor-type-id="text-editor">
- <state line="9" column="41" selection-start="242" selection-end="242" vertical-scroll-proportion="0.0">
+ <state line="17" column="4" selection-start="478" selection-end="478" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/rebar.config">
+ <entry file="file://$PROJECT_DIR$/priv/html/index.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="6" column="80" selection-start="484" selection-end="484" vertical-scroll-proportion="0.2616279">
+ <state line="24" column="4" selection-start="1117" selection-end="1117" vertical-scroll-proportion="0.7070707">
<folding />
</state>
</provider>
View
BIN priv/erlanghub.sqlite
Binary file not shown.
View
4 src/default_handler.erl
@@ -2,7 +2,7 @@
-module(default_handler).
-behaviour(cowboy_http_handler).
--export([init/3, handle/2, terminate/2]).
+-export([init/3, handle/2, terminate/3]).
init({_Any, http}, Req, []) ->
{ok, Req, undefined}.
@@ -24,7 +24,7 @@ handle(<<"GET">>, <<"/favicon.ico">>, Req) ->
{ok, Req2} = cowboy_req:reply(200, [{<<"content-type">>, <<"image/x-icon">>}], Bin, Req),
{ok, Req2}.
-terminate(_Req, _State) ->
+terminate(_Reason, _Req, _State) ->
ok.
file(Path) ->
View
15 src/erlanghub_cowboy.erl
@@ -6,15 +6,14 @@ start() ->
application:start(ranch),
application:start(cowboy),
- Dispatch = [
+ Dispatch = cowboy_router:compile([
{'_', [
- %{[], home_handler, [<<"html">>, <<"index.html">>]},
- {[<<"static">>, '...'], cowboy_static, [{directory, {priv_dir, erlanghub, [<<"static">>]}}]},
- {[<<"pull">>], erlanghub_pull_handler, []},
- {[], default_handler, []}
+ {"/static/[...]", cowboy_static, [{directory, {priv_dir, erlanghub, "static"}}]},
+ {"/pull", erlanghub_pull_handler, []},
+ {'_', default_handler, []}
]}
- ],
- cowboy:start_http(sample_http_handler, 100,
- [{port, 19860}], [{dispatch, Dispatch}]
+ ]),
+ {ok, _} = cowboy:start_http(http, 100,
+ [{port, 19860}], [{env, [{dispatch, Dispatch}]}]
),
ok.
View
4 src/erlanghub_pull_handler.erl
@@ -2,7 +2,7 @@
-export([init/3]).
-export([handle/2]).
--export([terminate/2]).
+-export([terminate/3]).
init(_Transport, Req, []) ->
{ok, Req, undefined}.
@@ -39,5 +39,5 @@ since(_, _, Req) ->
%% Method not allowed.
cowboy_req:reply(405, Req).
-terminate(_Req, _State) ->
+terminate(_Reason, _Req, _State) ->
ok.
View
9 src/github_server.erl
@@ -26,7 +26,9 @@ handle_cast(_Msg, State) ->
{noreply, State}.
handle_info(trigger, Cache) ->
- case httpc:request(get, {"https://api.github.com/events", []}, [{timeout, 10000}], []) of
+ {ok, Username} = application:get_env(erlanghub, username),
+ {ok, Password} = application:get_env(erlanghub, password),
+ case httpc:request(get, {"https://api.github.com/events", [auth_header(Username, Password)]}, [{timeout, 10000}], []) of
{error, Reason} ->
io:format("github_server error in https:request:~p~n", [Reason]),
NewCache = Cache;
@@ -88,3 +90,8 @@ publish([{<<"TRUE">>}], E) ->
tinymq:push("events", jiffy:encode(E));
publish([{<<"FALSE">>}], E) ->
ok.
+
+
+auth_header(User, Pass) ->
+ Encoded = base64:encode_to_string(lists:append([erlang:atom_to_list(User),":",erlang:atom_to_list(Pass)])),
+ {"Authorization","Basic " ++ Encoded}.
View
2 start.sh
@@ -1,3 +1,3 @@
#!/bin/sh
rebar compile
-erl -pa $PWD/ebin -pa $PWD/deps/*/ebin +K true +A 4 -s erlanghub -eval "io:format(\"http://localhost:19860/~n\")."
+erl -pa $PWD/ebin -pa $PWD/deps/*/ebin +K true +A 4 -s erlanghub -config ../erlanghub.config -eval "io:format(\"http://localhost:19860/~n\")."

0 comments on commit 153b063

Please sign in to comment.